visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: PHP text redirect


By: PHP newbee U.S.A.  Date: 25/09/2003 00:00:00  English  Points: 300 Status: Answered
Quality : Excellent
hi i need some code in php to simply pop up a dialog box or submit from a form an number typed in by a user like a username and to have the script take that number and redirect there browaser to it as a url ge if thay type in 12345 and submit or ok it redirects them to <A HREF="http://www.domain.com/12345">http://www.domain.com/12345</a>
By: VGR Date: 25/09/2003 06:06:00 English  Type : Answer
1) popup AND form (you can comment fi "if cofirm" IMHO, just leave the location.href=...)

<?php
echo <<<EOS
<script language=javascript>
function go() {
par=document.forms.main.dest.value;
if confirm("do you wanna go to "+par+" ?") window.location.href=eval("<A HREF="http://www.domain.com/">http://www.domain.com/</a>"+par);
} // go function
</script>
<form name=main>
<input type=text name=dest value="">
<input type=button value="go to there" onClick="go();">
</form>
EOS;
?>


2) you could also use a standard FORM and just use a action=redirect.php with the field "dest"

this would be redirect.php :
<?php
Header("Location: <A HREF="http://www.domain.com/">http://www.domain.com/</a>{$_POST['dest']}");
?>

Do register to be able to answer

EContact
browser fav
page generated in 328.341010 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page