Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   PHP / mySQL (http://siteownersforums.com/forumdisplay.php?f=10)
-   -   create dynamic php page title? (http://siteownersforums.com/showthread.php?t=64754)

noahwilson 05-06-2013 04:38 AM

create dynamic php page title?
 
Hi friends,
I want to make my website's product-detail pages title dynamic. so help me how can i create this in php. please share your suggestion.
thanks.

binarynpixel 05-16-2013 02:55 AM

Hi Noah i think this code will be helpful for you

error_reporting("E_ALL ^ E_NOTICE");

$story = $_GET['story'];
include 'admin/connect.php';
$getlist="Select * from news where id='$story'";
$result= mysqli_query($con,$getlist);
while($row= mysqli_fetch_array($result))

{

$a=$row[Heading];

}

?>
and put this code in heading code between title tag code are below:
<?php echo $a;?>

Ranjan123 10-16-2013 09:07 AM

Pick up the title from mysql before html tag eg. title variable is $title.
Quote:

Quote:

echo the title in <? echo $title;?>


NicholasCage 12-16-2013 10:37 AM

database query is the best..

lampdev112 12-18-2013 05:31 AM

would advise that you use a templating engine such as PHPTAL, or XSLT if you prefer, rather than having header and footer files to do your printing.

simar 03-07-2014 01:28 AM

We can create the dynamic page with the help of php. For known about the tutorial php w3school is best tutorial provide.......

softwin.swapna 03-07-2014 02:29 AM

thanks it works......

shubhamgautam 04-17-2014 11:20 PM

In php you have to store the pages in a database and from there you have to fetch these images using suitable function to show the images. Put the images in a folder. You have to put edit, delete, and update queries with it.

guiltyCrown 04-23-2014 12:12 AM

Quote:

Originally Posted by lampdev112 (Post 356008)
would advise that you use a templating engine such as PHPTAL, or XSLT if you prefer, rather than having header and footer files to do your printing.

Agreed. Best way. Also don't use queries on each page just for this. Create another variable in the php page called page_title to which you add as you generate the page (e.g. add article title if any) then output it in the template system.


All times are GMT -7. The time now is 06:10 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.