| View previous topic :: View next topic |
| Author |
Message |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Sun Feb 03, 2008 2:38 pm Post subject: HTML HELP : POST |
|
|
Im trying to post to a file!(NOT WRITE TO A FILE[[already know how to do that]])
HTML > PHP
What I am trying to do:
I want to post the words in a textbox from index.html to index.php so that it loads the following Url :
| Code: |
http://site.com/index.php?name=TEXT-Box-NAME
|
If you don't understand what i am asking, please jus post,and i will give more details.
thanks! _________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
| Back to top |
|
 |
iCucco Advanced Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 51 Location: 0x0600
|
Posted: Sun Feb 03, 2008 2:58 pm Post subject: |
|
|
| Code: | <form action="http://site.lol/index.php?tagz=Wtfbbq" method="POST">
<input type="text" name="BbqTYPE"><input type="submit" value="send">
</form>
|
That sends the value of text box to index.php and also defines $_GET["tagz"].
If you meant to be it like:
1. Type "asd" to textbox named "tb1"
2. Click submit
3. The Url is now "form_location.php?tb1=asd"
then the answer is Get method. It is recommended to use POST though. _________________
printf("You just ate a %X!!\n",3735928559); |
|
| Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Sun Feb 03, 2008 3:18 pm Post subject: |
|
|
| iCucco wrote: | | Code: | <form action="http://site.lol/index.php?tagz=Wtfbbq" method="POST">
<input type="text" name="BbqTYPE"><input type="submit" value="send">
</form>
|
That sends the value of text box to index.php and also defines $_GET["tagz"].
If you meant to be it like:
1. Type "asd" to textbox named "tb1"
2. Click submit
3. The Url is now "form_location.php?tb1=asd"
then the answer is Get method. It is recommended to use POST though. |
I dont see how that works.....BBQType....where did that come from?and where did wtfbbq come from?
I don't think this is the correct code...
Edit:
Nope, Doesnt work.
The Url stays the same, even if i change the text in the textbox... _________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
| Back to top |
|
 |
iCucco Advanced Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 51 Location: 0x0600
|
Posted: Sun Feb 03, 2008 3:33 pm Post subject: |
|
|
Lol sorry, I am being unclear due to I'm writing this with cellphone.
Do you want to
1. Send specific input via POST to index.php?name=what-ever-it-was
2. Send messagebox which name is "text" via GET to index.php so the Url will be index.php?text=value (where value is what you typed into textbox "text")
I'm sick of Nokias.
EDIT: ooh got it now. Try
| Code: | <form action="index.php" method="post">
<input type="text" name="text" value="Name-of-a-textbox">
<input type="submit" value="ok">
</form> |
_________________
printf("You just ate a %X!!\n",3735928559);
Last edited by iCucco on Sun Feb 03, 2008 3:42 pm; edited 2 times in total |
|
| Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Sun Feb 03, 2008 3:38 pm Post subject: |
|
|
| iCucco wrote: | Lol sorry, I am being unclear due to I'm writing this with cellphone.
Do you want to
1. Send specific input via POST to index.php?name=what-ever-it-was
2. Send messagebox which name is "text" via GET to index.php so the Url will be index.php?text=value (where value is what you typed into textbox "text")
I'm sick of Nokias. |
Option 2.
What ever is in the textbox is what will be linked.
Example
Text Box Value : name000
onButton Click : Url = "http://site.lol/index.php?name=name000 _________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
| Back to top |
|
 |
iCucco Advanced Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 51 Location: 0x0600
|
Posted: Sun Feb 03, 2008 3:40 pm Post subject: |
|
|
See my edit. _________________
printf("You just ate a %X!!\n",3735928559); |
|
| Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Sun Feb 03, 2008 4:16 pm Post subject: |
|
|
Still doesn't work.
It just goes to the link index.php
not index.php?name=VALUEHERE _________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
| Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Sun Feb 03, 2008 4:32 pm Post subject: |
|
|
| Code: | | href=index.php?box=text |
like that?
btw, the own thread link is like the example. _________________
|
|
| Back to top |
|
 |
iCucco Advanced Cheater
Reputation: 0
Joined: 11 May 2007 Posts: 51 Location: 0x0600
|
Posted: Mon Feb 04, 2008 8:18 am Post subject: |
|
|
| Code: | <form action="index.php" method="GET">
<input type="text" name="text" value="This time the method is GET">
<input type="submit" value="ok">
</form> |
_________________
printf("You just ate a %X!!\n",3735928559); |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon Feb 04, 2008 11:32 am Post subject: |
|
|
Index.html to handle the input:
| Code: | <HEAD>
<TITLE> Some shit here for a title.. </TITLE>
</HEAD>
<BODY>
<FORM NAME="input" ACTION="index.php?name=" METHOD="GET">
<TABLE BORDER="1" CELLPADDING="1" CELLSPACING="1">
<TR>
<TD>Username: <INPUT TYPE="TEXT" NAME="name"> <INPUT TYPE="SUBMIT" VALUE="Enter"></TD>
</TR>
</TABLE>
</FORM>
</BODY> |
And the index.php to handle the inputted value:
| Code: | <?php
if( (isset($_GET['name'])) && ($_GET['name'] != '') )
{
echo( "Username entered was: " . $_GET['name'] );
}
else
{
echo( "Invalid username entered, or no name entered at all." );
}
?> |
Example posted up at: http://www.ffact.org/CEF/index.html _________________
- Retired. |
|
| Back to top |
|
 |
|