Chevy Posted December 22, 2006 Share Posted December 22, 2006 Okay well this script I am running works perfectly so far, but once the script echo's a link then that link stops where there is a %20[code]$insertt = mysql_query("INSERT INTO `mail`(`to`, `from`, `date`, `message`, `title`) VALUES('$ho2[username]', '$user_ffo[username]', '$date', '$country would like to be allies with you, $country2<br><br><a href=ally.php?country=$country&country2=$country2>Click here for options!</a>', 'Ally Request!')");[/code]$country has a space like Cookie Monster$country2 also has a spaceThen when it goes and echo's the link will be[code]<a href=ally.php?country=Cookie></a>[/code]When I want it to be[code]<a href=ally.php?country=Cookie Monster&country2=Cookie Monster2>Click Here!</a>[/code]Any help? Quote Link to comment Share on other sites More sharing options...
Chevy Posted December 22, 2006 Author Share Posted December 22, 2006 Oh and in the database it has a %20, but when it echo's it gets taking out then stops the link :? Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted December 22, 2006 Share Posted December 22, 2006 I'm not exactly sure what you are doing here. About the script and the link. Can you explain what the script is about or what it does? So I can more clearly understand your question. Also, can you paste the script in a more eye pleasing way? Quote Link to comment Share on other sites More sharing options...
Chevy Posted December 22, 2006 Author Share Posted December 22, 2006 Well it is basically sending a message to the owner of a country and asking them to be an ally. The link will not work right, I think I explained it enough above. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 22, 2006 Share Posted December 22, 2006 That %20 is a replacement for an empty space. You can't have empty spaces in a URL. It has to be populated with a dash or underscore or some other connecting character. Quote Link to comment Share on other sites More sharing options...
Chevy Posted December 23, 2006 Author Share Posted December 23, 2006 [code]Novus%20Ager would like to be allies with you, Gottleute<br><br><a href=ally.php?country=Novus%20Ager&country2=Gottleute>Click here for options!</a>[/code]That exactly what gets sent to the DB and I just echo that Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2006 Share Posted December 23, 2006 Post some actual code, your descriptions of your problem leave something to be desired. Quote Link to comment Share on other sites More sharing options...
Chevy Posted December 23, 2006 Author Share Posted December 23, 2006 [code=php:0]if ($act == "view"){$frill = mysql_fetch_array(mysql_query("SELECT * FROM `mail` WHERE `id`='$id'"));$hjh = stripslashes($frill['message']);$hjh2 = stripslashes($frill['title']);if ($frill['to']!=$user_ffo['username']){error("This is not your mail to view!<br><br><a href=\"JavaScript:history.go(-1)\">Go Back</a>");}$update = mysql_query("UPDATE `mail` SET `status`='Read' WHERE `id`='$id'");echo '<table width="500" cellspacing="2" cellpadding="2"><tr><td style="border:1px solid black;" bgcolor="#A3A3A3" align="center"><b>Viewing Message</b></td></tr></table><table width="500" cellspacing="2" cellpadding="2"><tr><td style="border:1px solid black;">To: <b>'.$frill['to'].'</b></td></tr><tr><td style="border:1px solid black;">Subject: <b>'.$hjh2.'</b></td></tr><tr><td style="border:1px solid black;">'.$hjh.'<br><br><a href="mail.php?act=create&user='.$frill['from'].'">Reply</a></td></tr></table>';include("footer.php");exit;}[/code]^ Thats where you view the message..And[code=php:0]$insertt = mysql_query("INSERT INTO `mail`(`to`, `from`, `date`, `message`, `title`) VALUES ('$ho2[username]', '$user_ffo[username]', '$date', '$country would like to be allies with you, $country2<br><br><a href=ally.php?country=$country&country2=$country2>Click here for options!</a>', 'Ally Request!')");[/code]Thats the sending of the message Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2006 Share Posted December 23, 2006 Yeah... you might want to use [url=http://php.net/urlencode]urlencode[/url]() around your url. Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted December 23, 2006 Share Posted December 23, 2006 Yes, before you stick the variable in the URL, use urlencode() and to take it out of the URL with the space in it, use urldecode(). Quote Link to comment Share on other sites More sharing options...
Chevy Posted December 23, 2006 Author Share Posted December 23, 2006 Thank you :) 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.