Jump to content

this form -> (html combing php )not work


ahmed17

Recommended Posts

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 :

[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>[/code]



_____________
php code
_____________
[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>[/code]
Link to comment
https://forums.phpfreaks.com/topic/19919-this-form-html-combing-php-not-work/
Share on other sites

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):

[code]
<?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>
[/code]

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...

[code]
<?php
phpinfo();
?>
[/code]

Do you get a full PHP output?

Regards
Rich

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.