Jump to content

hyperlink in a php echo line


pouncer

Recommended Posts

[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 error

Parse 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?
Link to comment
Share on other sites

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]

<?php

function 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]
Link to comment
Share on other sites

[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]

<?php

function 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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.