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!
This is meant to grab all the URL from the page.
The problem I've got is that in the URL that I am grabbing, there will be & signs.
Furthermore, I am posting the grabbed URL and placing it on the end of the current URL. The purpose is to use a text link to post the URL to a form, while keeping the contents of the page, within the page.
So the result with the grabbed URL is something like this:
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
I've done that, but I am assuming I am meant to be seeing the & signs turned into something else - but nothing changes.
Also, with that posting via the URL to the next page, do I just extract it via the $url=$_REQUEST['url'];, and insert it into the 'send friend' form via $url?
I ask all this, because it still only goes up to the first &.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis wrote:I've done that, but I am assuming I am meant to be seeing the & signs turned into something else - but nothing changes.
Also, with that posting via the URL to the next page, do I just extract it via the $url=$_REQUEST['url'];, and insert it into the 'send friend' form via $url?
I ask all this, because it still only goes up to the first &.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
simonmlewis wrote:May I ask why not?
I have forgotten to show the echo ""; part in the code, but apart from that it looks ok.
Yeah the echo ""; part makes a difference. Aside from that though, I can't see a problem. I have no idea why you're not getting the correct output. It must be something else (not updating the file when you make changes, working on the wrong code, etc...)
It's odd that in your echo you use double quotes around the href, but the output that you show has single quotes That's not the output from that code.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
echo '<div style="float: right; text-align: right; width: 305px; margin-right: 10px">
<a href="index.php?page=selectorsend&menu=home&id1=$id1&id2=$id2&id3=$id3&id4=$id4&id5=$id5&url=' . urlencode($url) . '" style="text-decoration: none"><img src="images/btn_sendfriend.png" border="0" /></a>
<a href="javascript:history.back()"><img src="images/btn_remove.png" border="0" /></a>
<a href="index.php?page=selector&menu=home" style="text-decoration: none"><img src="images/btn_restart.png" border="0" /></a>
<br/>Send this to yourself or your friends to review.<br/>Then you or they can come back and make the purchase.</div>';
PROBLEM:
All this now renders is id1=$id1 in the URL, not the dynamic id1=311 (for example).
The 'id's are all REQUESTED at the top of the page. Is it something to do with my ' and " usage??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
$newurl = urlencode($url);
echo "<div style='float: right; text-align: right; width: 305px; margin-right: 10px'>
<a href='index.php?page=selectorsend&menu=home&id1=$id1&id2=$id2&id3=$id3&id4=$id4&id5=$id5&url=$newurl' style='text-decoration: none'><img src='images/btn_sendfriend.png' border='0' /></a>
<a href=\"javascript:history.back()\"><img src='images/btn_remove.png' border='0' /></a>
<a href='index.php?page=selector&menu=home' style='text-decoration: none'><img src='images/btn_restart.png' border='0' /></a>
<br/>Send this to yourself or your friends to review.<br/>Then you or they can come back and make the purchase.</div>";
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.