Jump to content


Photo

this form -> (html combing php )not work


  • Please log in to reply
5 replies to this topic

#1 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 06 September 2006 - 03:47 PM

hello , this form -> (html combing php )not work 
it take user name and address and preview it in other page
  what is the problem  in this script ..i test it in local and remote server but not work


html code :

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
 <form action="test.php">
 <pre>
<b>enter user name</b>    <input type="text" name="user">
 <br><br>
<b>enter your address</b> <textarea name="address" rows="5" cols="40" ></textarea>
 <br> <br>                     <input type="submit" value="press here ">
 </form>
</body>
</html>



_____________
php code
_____________
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
<?php
print"<pre>";
print "welcome  :$user <br>";
print"your address is :$address";
?>
</body>
</html>


#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 06 September 2006 - 03:55 PM

Try this, change the <form> tag on your HTML page to this:

<form action="test.php" method="get">

Then change your variable names in test.php to this...

echo "welcome  :$_GET['user'] <br>";

Regards
Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 06 September 2006 - 05:19 PM

not work yet

#4 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 06 September 2006 - 10:23 PM

plz help me to correct this script

#5 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 07 September 2006 - 10:35 AM

Your form looks fine, so long as you changed the previous line as suggested.

Make this your test.php code (copy and paste it if you have to):

<?php
   $user = $_GET['user'];
   $address = $_GET['address'];
?>
<html>
 <head>
  <title>Title here!</title>
 </head>
 <body>
  <pre>
   Welcome : <?php echo $user; ?><br>
   Your address is : <?php echo $address; ?>
  </pre>
 </body>
</html>

If this doesn't work, perhaps you could tell us what IS happening.  Do you definitely have PHP installed.  If you create a page called info.php and code it like this...

<?php
phpinfo();
?>

Do you get a full PHP output?

Regards
Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#6 ahmed17

ahmed17
  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 07 September 2006 - 06:57 PM

thanks more HuggieBear ....script  work well ... :) :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users