Jump to content

Form submitting


mynameisbob

Recommended Posts

what is the equivelant to php 4s

 

<form method=post action=file.php?action=1234>

<input type=submit value=Clear name=clear>

</form>

 

<?php

 

if($action == 1234)

{

print"hi";

}

?>

and the website would be something like www.xxx.com/file.php?action=1234

 

that wouldnt work in php 5 but it does in php 4.

 

I know in php 5 it would be something using $_POST or $_GET but im not to keen these.

Link to comment
Share on other sites

Try this, should be pretty self explanatory, but if you have questions please ask:

 

</pre>
<form method="GET" action="file.php?action=1234">

</form>
<br><br><br>if($_GET['$action'] == 1234)<br>{<br>   print"hi";<br>}<br

Link to comment
Share on other sites

Form method POST and you want to get something via GET method ? Why ?

If you want to get something from URL, use GET - if you want to get something from somewhere ( buffer ), use POST. As simple as that  ;)

Link to comment
Share on other sites

ok, i mean in php 4 you could use

 

say there was a form at the link www.xxx.com/link.php and it brought you to that same page but with ?action=1234 that said

name: "bob"  as what you typed in and the name was "name"

if ($action == 1234)

{

print"$name";

exit;

}

 

and on the website it would say bob

 

but in php 5 it doesnt work

 

 

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.