Page 1 of 1
Textbox Input and put into code
Posted: Fri Sep 29, 2006 6:31 pm
by dclamp
I want to have a page that has a text box where they put in their ID number and they press accept and then it adds it to the end of a URL in some code. here is the code:
Code: Select all
<a href="http://dclamp.homtek.net/invite.php?id=INSERT_HERE"><img src="http://rapidfriends.com/images/logorf.jpg" alt="Promote RapidFriends Networking"></a>
and that is going to be in a <textarea> </textarea> box.
thanks to all the help in advanced!
Posted: Fri Sep 29, 2006 6:47 pm
by Luke
change your form method to "get"
Code: Select all
<form method="get"><input type="text" name="id">
Posted: Fri Sep 29, 2006 6:47 pm
by dclamp
how do i have it insert to where i want it to?
Posted: Fri Sep 29, 2006 6:50 pm
by Luke
in the url? Did you try what I said?
Posted: Fri Sep 29, 2006 6:52 pm
by dclamp
how do i have it display the code? i am very lost here...
Posted: Fri Sep 29, 2006 6:55 pm
by Luke
I misunderstood your question... use
$_POST or
$_GET depending on which method you use in your form IE method="post" then use $_POST
Posted: Fri Sep 29, 2006 6:58 pm
by dclamp
ok. i am new to php. i dont know what you are saying. lol. i am sorry. if you could like explain it step by step

Posted: Fri Sep 29, 2006 7:23 pm
by waradmin
ignore me for a min
Posted: Fri Sep 29, 2006 7:40 pm
by Luke
dclamp wrote:ok. i am new to php. i dont know what you are saying. lol. i am sorry. if you could like explain it step by step

did you read the page I posted a link to??
Posted: Fri Sep 29, 2006 8:39 pm
by dclamp
I really dont understand them. I dont know what to look for. maybe i am makeing myself unlclear. Here is what i am looking to do:
The user visits the page, there is a textbox that the user types in their ID number. They click "Submit".
Then the form disappears and a textarea box apears with the following code and the ID that the typed in where it says "ID_HERE".
<a href="
http://dclamp.homtek.net/invite.php?id=ID_HERE"><img src="url"></a>
Posted: Sat Sep 30, 2006 8:30 am
by miro_igov
On the first page add this:
Code: Select all
<form action="http://dclamp.homtek.net/invite.php" method="get" name="form1">
<input type="text" name="id">
<input type="button" onclick="document.form1.submit()">
</form>
In invite.php add this:
Code: Select all
<?php
if(isset($_GET['id'])) {
echo '<textarea><a href="http://dclamp.homtek.net/invite.php?id='.$_GET['id'].'"><img src="http://rapidfriends.com/images/logorf.jpg" alt="Promote RapidFriends Networking"></a> </textarea>';
}
?>