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
softya
Forum Newbie
Posts: 2 Joined: Mon Jul 27, 2009 10:32 pm
Post
by softya » Fri Jul 31, 2009 4:04 am
I have made a simple form named test.php. This form is opened through other local page with certain parameters.(example 'item1' and 'forumid')
Following is the example link.
http://localhost/studygroup/test/test.p ... mesite.com
Following is code for test.php
Code: Select all
<?php
$forum_login_id = ($_GET['forumid']);
$$item1 = ($_GET['item1']);
echo $item1;
echo $forum_login_id;
?>
<html>
<form action=test-page1.php method="post">
<td align="right" nowrap>
<label for=Forum_ID>forum ID:</label>
<input id="forum_login_id" class="survey_list" maxLength="96" size="27" type="text" name="forum_login" value="<? "$forum_login_id";?>"
</td> <br><br>
<td><label for=item1>item1</label>
<input id="item1" class="survey_list" maxLength="96" size="27" type="text" name="item1" value="<? "$item1";?>"
</td> <br>
<br>
<td align="right" nowrap>
<label for=Comments>Comments:</label>
<input id="comments" class="survey_list" value="" maxLength="100" size="75" type="textbox" name="comments" />
</td><br><td align="right" nowrap>
<input type="submit" name="btnSendForm" value="Send" /></tr>
</form>
</html>
ScreenShot001.gif (2.61 KiB) Viewed 215 times
Now what I am trying to do is fetching variable of url into the boxes and displaying the results.
However, I am unable to to this. Please see the code and guide me further.
Regards
marty pain
Forum Contributor
Posts: 105 Joined: Thu Jun 11, 2009 5:32 am
Location: Essex
Post
by marty pain » Fri Jul 31, 2009 4:55 am
Close!
<input id="forum_login_id" class="survey_list" maxLength="96" size="27" type="text" name="forum_login" value="<? echo $forum_login_id; ?>"
Try that.
Also, <? and not <?php, will only work if you have sort tags enabled in your PHP.ini file, so if it still doesn't work swap <? with <?php.