pouncer Posted November 7, 2006 Share Posted November 7, 2006 [code=php:0]function RedirectBackToLogin() { echo "<br>You will be redirect back to the main login page in 5 seconds, or click <a href="index.html">here</a> to go back.<br>";}[/code]keeps giving me errorParse error: parse error, unexpected T_STRING, expecting ',' or ';'and can someone show me how to make it go back to index.html after 5 seconds? Quote Link to comment Share on other sites More sharing options...
alpine Posted November 7, 2006 Share Posted November 7, 2006 You must escape double quotes within a string that's started and ended with double quotes: \"index.html\"+ EDIT: You can use meta refresh to redirect[code]<?phpfunction RedirectBackToLogin() {echo "<meta http-equiv=\"refresh\" content=\"5; url=index.html\" />";echo "<br>You will be redirect back to the main login page in 5 seconds, or click <a href=\"index.html\">here</a> to go back.<br>";}?>[/code] Quote Link to comment Share on other sites More sharing options...
freakus_maximus Posted November 7, 2006 Share Posted November 7, 2006 try wrapping your echo in ()[code]echo ("<br>You will be redirect back to the main login page in 5 seconds, or click <a href='index.html'>here</a> to go back.<br>");[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted November 7, 2006 Share Posted November 7, 2006 [quote]try wrapping your echo in ()[/quote]Why? echo is not a function! Quote Link to comment Share on other sites More sharing options...
pouncer Posted November 7, 2006 Author Share Posted November 7, 2006 [quote author=alpine link=topic=114199.msg464554#msg464554 date=1162939186]You must escape double quotes within a string that's started and ended with double quotes: \"index.html\"+ EDIT: You can use meta refresh to redirect[code]<?phpfunction RedirectBackToLogin() {echo "<meta http-equiv=\"refresh\" content=\"5; url=index.html\" />";echo "<br>You will be redirect back to the main login page in 5 seconds, or click <a href=\"index.html\">here</a> to go back.<br>";}?>[/code][/quote]Thanks Alpine, perfect. Only problem is when the word 'here' gets hyperlinked my page backgrounds are all dark colors so i can't see the word clearly.is there a way to set the hyperlink color to white or something? Quote Link to comment Share on other sites More sharing options...
alpine Posted November 7, 2006 Share Posted November 7, 2006 <a href=\"index.html\" style=\"color:#ffffff\">here</ a> Quote Link to comment Share on other sites More sharing options...
pouncer Posted November 7, 2006 Author Share Posted November 7, 2006 awesome. thanks Quote Link to comment Share on other sites More sharing options...
freakus_maximus Posted November 7, 2006 Share Posted November 7, 2006 Thorpe - Your right, I was looking at the actual error though when I wrote that.[quote]Parse error: parse error, unexpected T_STRING, expecting ',' or ';'[/quote] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.