Help with escape quotes

#1

This post was flagged by the community and is temporarily hidden.

#2

I don’t know what the format is you are looking for. That will give you the URL and whatever is being retrieved by the call. I take it that isn’t what you are wanting?

#3

This post was flagged by the community and is temporarily hidden.

#4

I have no idea what you are talking about… You need to give more information if you want assistance.

#5

sorry for the confusion, but the commands keep gettin edited out

I am trying to create a dynamic button in my wordpress blog.

The code I’m trying to use is:
<?php
$current_user = wp_get_current_user();
$website=‘mysite.com/homework-’ . $current_user->user_login;
echo $website;
echo “”;
echo input type=“button” style=“width:120px;height:60px” value=“BACK HOME” onclick=“window.location=‘http://mysite.com/homework-$current_user->user_login’”/
?>;

the address I want is the value of ‘$website’(it returns the correct value) but I’m unable to put it in the correct format on the line “input type…”.
Can anyone help or point me in the correct direction.

#6

when using echo, the string should be enclosed in single or double quotes:

echo '<input type="button" />';

i suspect that you are having trouble with the javascript onclick statement. why not echo that value of the $website variable?

<?php
$current_user = wp_get_current_user();
$website='mysite.com/homework-' . $current_user->user_login;
echo $website;
echo '';
?>
<input type="button" style="width:120px;height:60px" value="BACK HOME"
onclick="window.location='<?php echo $website; ?>';" />
#7

It worked beautifully. Thanks