it works!!! Posted December 27, 2008 Share Posted December 27, 2008 After posting the selected category and the subcategory the names of respective objects from the DATABASE in div "objects" ne the same page with the form that has this layout: this is the php code: <?php include("dbinfo.php"); $connection = mysql_connect("server",$username,$password); if (!$connection) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db($database, $connection); if (!$db_selected) { die ('Can\'t use db : ' . mysql_error()); } $result1=mysql_query("Select idg from Grupimi where grupim='$_POST[category]' and detaje='$_POST[subcategory]'") or die(mysql_error()); $row1 = mysql_fetch_array($result1); $klasifikimi = $row1['idg']; $result2=mysql_query("Select oemer from Objekt where klasifikimi='$klasifikimi'") or die(mysql_error()); <? }else{ while($row2 = mysql_fetch_array($result2)){ echo $row2['oemer']; echo "<br/>"; } } mysql_close($connection); ?> Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/ Share on other sites More sharing options...
chronister Posted December 27, 2008 Share Posted December 27, 2008 That is as clear as mud. Please explain in a little more detail what you are hoping to accomplish. Nate Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724377 Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 ok! Look at this picture and maybe you'll understand better. Thank you! Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724384 Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724385 Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 Hello gerta, I will continue to help you on here instead Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724387 Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 I need this: 1. The name of your script that makes that form 2. The code for the page (surrounded in CODE tags) Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724388 Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 Can you work in the other forum please cause i have posted there the code? Thank you again! Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724392 Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 OK where's the PHP code - that's just the HTML? You can do what I do and incorporate your PHP and HTML into one page - here's an example... <?php $strName=$_POST['name']; if ($_POST['subshow']) { //user clicked submit so validate here } ?> <html> <head> <title>My Page</title> </head> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> Name: <input type="text" name="name" value="<?=$strName?>" /><br /> <input type="submit" name="subshow" value="Show Data" /> </form> You entered: <?=$strName?> </body> </html> EDIT: When showing data inside a textbox do it like this: <textarea name="mytextbox" cols="40" rows="7"><?=$txtSomeText?></textarea> Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-724397 Share on other sites More sharing options...
448191 Posted December 29, 2008 Share Posted December 29, 2008 TS, please stop using "PLEASE HELP!!!!"/"URGENT!!!!"-type titles. Thank you. Link to comment https://forums.phpfreaks.com/topic/138544-how-to-display-the-data-had-by-a-html-form-in-a-div-in-the-same-page/#findComment-725078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.