problems with long URLs like at mail again
| From: | Iwan Sujana | Date: | Mon, 04 Sep 2000 04:15:28 +0000 |
| Subject: | problems with long URLs like at mail again | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15043@lists.php.net to get a copy of this message | ||
Hi !
Sorry, everyone, I gave you the wrong script.
Again: I have a script that works but the receiver have problems with long URLs
like at mail. For this the receiver must go to my website and enter pickup
id . I don't want to give pickup_id for the receiver.Do you have solution?
This is the true script:
<?php
include("postcardheader.inc");
include("postcardconfigure.inc");
// CLEAN UP HIDDEN FIELDS
$htext = urldecode("$htext");
$message = urldecode("$message");
$rname = urldecode("$rname");
$sname = urldecode("$sname");
$rmail = urldecode("$rmail");
$smail = urldecode("$smail");
// GENERATE A CARD ID
$random = md5 (uniqid (""));
$unique = substr ("$random", 0, 22);
// ADD DB SLASHES
$htext2 = addslashes("$htext");
$message2 = addslashes("$message");
$sname2 = addslashes("$sname");
$smail2 = addslashes("$smail");
$rname2 = addslashes("$rname");
$rmail2 = addslashes("$rmail");
// INSERT DATA
mysql_connect($host,$user,$password);
@mysql_select_db("$db") or die("Unable to open database");
$query = "insert into $table (id, pic, sound, pbcolor, hbcolor, htcolor, hfont, htext, mbcolor,
mtcolor, mfont, message, sname, smail, rname, rmail, pickup_id, date) values
('','$pic','$sound','$pbcolor','$hbcolor','$htcolor','$hfont','$htext2','$mbcolor','$mtcolor','$mfont','$message2','$sname2','$smail2','$rname2','$rmail2','$unique',
now())";
$result = mysql_query($query);
$rows = mysql_affected_rows();
if ($rows == -1) {
echo "There was a problem adding that card to the database. Please try
again.<P>";
echo "<p align=center><input type='submit' value='Back'
onclick='history.go(-1)'></p>";
} else {
// SEND THE MAIL
$mailsender = "From: $sname <$smail>";
$subject = "A friend has sent you a Virtual Greeting Card from $sitename";
$mailmessage = "Hello $rname!\n\n $sname <$smail> has sent you a virtual greeting card
via $sitename\n\n
You can get your card at $installpath/pickup.php3?pickup_id=$unique\n\n
Some mail programs have problems with long URLs like the one above. So, if it's not a clickable
link, you can either cut and paste the entire link into your browser or get your card at
$installpath/pickup.php3 and use the following claim number:\n
$unique";
mail($rmail, $subject, $mailmessage, $mailsender);
?>
_____________________________________________________________
Mau kemana nih? http://www.kemana.com
Get your own: you@kemana.com email!