Hey all,
Got a tricky little problem here:
I wrote a bookmarklet and a php script to email the current url of the page I am on to myself. The bookmarklet looks like this:
javascript: var url = window.location.href; var user = 'myemail@email.com';window.open(myserver.com/mailurl.php?url=" + url + "&user="+ user);
The php script looks like this:
<?php
$url = $_GET["url"];
$user = $_GET["user"];
$subject = $_GET["title"];
$headers = 'From: MailURL' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
if (mail($user,$subject,$url,$headers)) {
echo("Mailed $url to $user");
} else {
echo("Failed to email $url to $user");
}
?>
Works great!
...
for simple urls like yahoo.com, google.com etc.
My issue is when I try to pass the php script a dynamic url (ex: yahoo.com/newstory/story.php?stuff=morestuff&more=opinion)
the php script will mangle the passed variable into this:
yahoo.com/newstory/story.php?stuff=morestuff
leaving off the last part of the url.
Any ideas?
Thanks!
PS: I am aware that there are free programs out there to sync bookmarks/probably do the exact same thing I'm trying to do, but this project is just for kicks.