Jump to content

index.php doesn`t start another php-file


L3P3000

Recommended Posts

Sorry,guys,just can`t get thru:

1.there`s a file index.php

<html>

<body>

<form action=/open.php>

<button  name=Jack value="150" type=submit>Send Form</button>

</form>

</body>

</html>

 

2.there`s another file open.php

<? echo $Jack; ?>

 

Press the button,in the address box it says:

http://mysite.net/open.php?Jack=150

 

But nothing happens,open.php doesn`t work.I got Denwer,open.php is in www.mysite.net.

 

Please,help.Thanx.

 

Link to comment
Share on other sites

You haven't added a POST method to your form.

 

<html>
<body>
<form action="open.php" method="post">
<button name="Jack" value="150" type="submit">Send Form</button>
</form> 
</body>
</html>

Link to comment
Share on other sites

<html>

<body>

<form action="open.php" method="post">

<button  name="Jack" value="150" type=submit>Send Form</button>

</form>

</body>

</html>

 

2.there`s another file open.php

<? echo $_POST['$Jack']; ?>

 

That should work for you.

Link to comment
Share on other sites

Is this from a book? If so I suggest you get a more up-to-date book to learn from. The code relies on register_globals which was depreciated in 5.3.0 and removed in PHP 5.4.0

Link to comment
Share on other sites

Is this from a book? If so I suggest you get a more up-to-date book to learn from. The code relies on register_globals which was depreciated in 5.3.0 and removed in PHP 5.4.0

 

Use of register globals was advised aginst as long ago as PHP Version 4.2 (2002) as this extract from php.net release history shows

 

Version 4.2.0

22-Apr-2002

■ATTENTION!! register_globals defaults to 'off' now !!!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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