xuniter Posted January 10, 2011 Share Posted January 10, 2011 Hi, can someone help me to understand this? What i want to do is to write some information in a form and after i submit the form that data will be in a new php page. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/ Share on other sites More sharing options...
trq Posted January 10, 2011 Share Posted January 10, 2011 Probably not exactly what your after but should give you a good idea of how dynamic page creation works. http://www.phpfreaks.com/forums/php-coding-help/now-that-i-know-what-to-ask-here-goes/msg446570/#msg446570 Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157343 Share on other sites More sharing options...
hyster Posted January 10, 2011 Share Posted January 10, 2011 follow the mysql tutorials. there easy to modify but remember to change <? to <?php else you may have problems http://phpeasystep.com/ Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157396 Share on other sites More sharing options...
Pikachu2000 Posted January 10, 2011 Share Posted January 10, 2011 The tutorials on that web site are largely obsolete, and I wouldn't recommend learning from them. Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157398 Share on other sites More sharing options...
xuniter Posted January 10, 2011 Author Share Posted January 10, 2011 thanks, but i want to know how to write the script so it could generate a .php with css... Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157558 Share on other sites More sharing options...
BlueSkyIS Posted January 10, 2011 Share Posted January 10, 2011 http://www.google.com/search?client=safari&rls=en&q=php+form+tutorial&ie=UTF-8&oe=UTF-8 Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157599 Share on other sites More sharing options...
trq Posted January 10, 2011 Share Posted January 10, 2011 thanks, but i want to know how to write the script so it could generate a .php with css... Your missing the point. Do you think every time you make a new post on this forum for instance, a new .php page is created? Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1157612 Share on other sites More sharing options...
xuniter Posted January 12, 2011 Author Share Posted January 12, 2011 ok now i will ask correctly sry about previous post, so how to make that the page will show different information using variables, example : www.domain.com/product.php?productid=42333 www.domain.com/product.php?productid=56326 It's the same page but it shows different info. Where can i read something about it or how it is called so i could search it Thank you very much Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1158402 Share on other sites More sharing options...
BlueSkyIS Posted January 12, 2011 Share Posted January 12, 2011 http://www.google.com/search?client=safari&rls=en&q=php+form+tutorial&ie=UTF-8&oe=UTF-8 Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1158410 Share on other sites More sharing options...
litebearer Posted January 12, 2011 Share Posted January 12, 2011 a VERY rough idea of how to do it. (NOTE - this example does NOT address any security issues)... The form page: <?PHP /* connect to your database */ include('db.php'); /* create the query */ $query = "SELECT id, product_name FROM FROM your_table_name WHERE id = '$productid'"; /* execute the query */ $result = mysql_query($query); /* display your form */ <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Select A Product</title> </head> <body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000"> <form action="processpage.phpt" method="get"> <select name="productid"> <?PHP while($row = mysql_fectch_array($result)) { ?> <option value="<?PHP echo $row['id']; ?>"><?PHP echo $row['product_name']; ?></option><br> <?PHP } ?> </select> <input type="submit" value="Submit"> </form> </body> </html> The processing page: <?PHP /* put the passed value into a variable */ $productid = $_GET['productid']; /* connect to your database */ include('db.php'); /* create your query */ $query = "SELECT product_name, description, price, quantity, image FROM your_table_name WHERE id = '$productid'"; /* execute the query */ $result = mysql_query($query); /* put the results into an array */ $row = mysql_fetch_array($result); /* display the information how you want */ ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Information for <?PHP echo $row['product_name']; ?></title> </head> <body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000"> Product name : <?PHP echo $row['product_name']; ?><br> <IMG src="<?PHP echo $row['image']; ?>"><br> Product price : <?PHP echo $row['price']; ?><br> Quantity Avail : <?PHP echo $row['quantity']; ?><br> Product description : <?PHP echo nl2br($row['description']); ?><br> </body> </html> (Passing variables via GET) Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1158486 Share on other sites More sharing options...
trq Posted January 12, 2011 Share Posted January 12, 2011 ok now i will ask correctly sry about previous post, so how to make that the page will show different information using variables, example : www.domain.com/product.php?productid=42333 www.domain.com/product.php?productid=56326 It's the same page but it shows different info. Where can i read something about it or how it is called so i could search it Thank you very much That is also covered in the link I provided. Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1158587 Share on other sites More sharing options...
xuniter Posted January 13, 2011 Author Share Posted January 13, 2011 thanks litebearer & thorpe, finally i got the whole idea and can proceed with Link to comment https://forums.phpfreaks.com/topic/223953-how-to-generate-php-pages/#findComment-1158889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.