PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
dclamp
Forum Commoner
Posts: 35 Joined: Sun Sep 17, 2006 10:05 am
Post
by dclamp » Fri Sep 29, 2006 6:31 pm
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!
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Sep 29, 2006 6:47 pm
change your form method to "get"
Code: Select all
<form method="get"><input type="text" name="id">
dclamp
Forum Commoner
Posts: 35 Joined: Sun Sep 17, 2006 10:05 am
Post
by dclamp » Fri Sep 29, 2006 6:47 pm
how do i have it insert to where i want it to?
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Sep 29, 2006 6:50 pm
in the url? Did you try what I said?
dclamp
Forum Commoner
Posts: 35 Joined: Sun Sep 17, 2006 10:05 am
Post
by dclamp » Fri Sep 29, 2006 6:52 pm
how do i have it display the code? i am very lost here...
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Sep 29, 2006 6:55 pm
I misunderstood your question... use
$_POST or
$_GET depending on which method you use in your form IE method="post" then use $_POST
dclamp
Forum Commoner
Posts: 35 Joined: Sun Sep 17, 2006 10:05 am
Post
by dclamp » Fri Sep 29, 2006 6:58 pm
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
waradmin
Forum Contributor
Posts: 240 Joined: Fri Nov 04, 2005 2:57 pm
Post
by waradmin » Fri Sep 29, 2006 7:23 pm
ignore me for a min
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Fri Sep 29, 2006 7:40 pm
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??
dclamp
Forum Commoner
Posts: 35 Joined: Sun Sep 17, 2006 10:05 am
Post
by dclamp » Fri Sep 29, 2006 8:39 pm
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>
miro_igov
Forum Contributor
Posts: 485 Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria
Post
by miro_igov » Sat Sep 30, 2006 8:30 am
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>';
}
?>