strings in php form wont work.. urgent help..

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

Post Reply
hailmunan
Forum Newbie
Posts: 3
Joined: Wed Sep 17, 2008 4:00 pm

strings in php form wont work.. urgent help..

Post by hailmunan »

hello all,

i`m trying to make users input the url into a text field.. and then.. when users hit the button,
it will bring the users to another page..
i`m having problems with the strings ..

can anyone help?
urgent..

Code: Select all

<?
 
 //print "$i. <a href='".$row['url']."'>".$row['url']."</a><br>\n";
$url = addslashes( $_POST['urlField'] );
print " 
 
<form name='form1' method='post' action='http://localhost/fyp/populate.php?url=http://".$url."'> 
  <label>
  <input type='text' name='urlField' id='urlField' value='http://'>
 
  <input type='submit' name='submitBtn' id='submitBtn' value='Submit'>
  </label>
</form>
 
";
 
?>
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: strings in php form wont work.. urgent help..

Post by yacahuma »

whithout asking what are you trying to do

Code: Select all

 
<form name='form1' method='post' action='populate.php'>
  <input type='text' name='urlField' id='urlField' value='http://'>
  <input type='submit' name='submitBtn' id='submitBtn' value='Submit'>
  <input type='hidden' name='url' id='url' value=<?=urlencode('http://' . $url)?>
  </label>
</form>
 
Post Reply