Jump to content

Archived

This topic is now archived and is closed to further replies.

lounger

Re: send page to friends help please

Recommended Posts

[b]where[/b] is that, or anywhere else, is the code that actually produces this stuff below:

[code]<div style="padding-top:4px;padding-left:10px;"><input type="text" size="70" name="url" value="http://www..com/gallery/I/2005/01/01/510.jpg" /></div>[/code]

Unless you can identify that, there's no hope of ever getting the image name [b]variable[/b] and being able to add it to your email script.  It's not a matter of everybody going silent (even though some people do have other things to do), it's all about not even getting close to the informaiton that's needed.

Share this post


Link to post
Share on other sites
[quote author=lounger link=topic=106569.msg426788#msg426788 date=1157232459]
i thought the image.php had the code that i needed to add to my email page script??
[/quote]

Look at the code you posted for image.php and tell me what is the variable name for the image that will be displayed.  As far as I can tell, it isn't there any more than there's anything on that page that would echo the html that's wrapped around it.

Share this post


Link to post
Share on other sites
hi andy the code for the variable is located in the gallery.php and here it is what do i need to do next with it??

*##############################
START IMAGE CLASS
##############################*/
$IMAGE2 = '<table style="margin-left:auto;margin-right:auto;"><tr><td>'."\n";

if ($b['rating'] >= '9.00') {

$IMAGE2 .= '<div class="pics2">'."\n";
$IMAGE2 .= '<div class="pics1">'.$LANG['116'].'</div>'."\n";
$IMAGE2 .= '</div>'."\n";

} elseif (checkdiff($b['time'],time(),"") == '17') {

$IMAGE2 .= '<div class="pics2">'."\n";
$IMAGE2 .= '<div class="pics1">'.$LANG['117'].'</div>'."\n";
$IMAGE2 .= '</div>'."\n";

}
$IMAGE2 .= "<div class=\"wrap1\">\n<div class=\"wrap2\">\n<div class=\"wrap3\">\n ".$IMAGELINK."\n";

$extra = $VAR[0]."/".$img2;

if (file_exists("".$VAR[5]."/".$img.""))
{
$IMAGE2 .= setIMAGE("".$VAR[0]."/$img",1,$extra,$b['width'],$b['height'],$b['id'],$newsize,$minussize);
}
else
{
if (file_exists("".$VAR[5]."/".$img2."")) {

$IMAGE2 .= setIMAGE("".$VAR[0]."/$img2",1,$extra,$b['width'],$b['height'],$b['id'],$newsize,$minussize);

} else {

$IMAGE2 .= '<img src="'.$VAR[0].'/images/noimage.jpg" alt="" width="120" height="90" />';

}
}

$IMAGE2 .= "</a>\n</div>\n</div>\n</div>\n</td>\n</tr>\n</table>\n";
/*##############################
END IMAGE CLASS
##############################*/

Share this post


Link to post
Share on other sites
this might be useful too-

if ($NUM7 == '2') // TEXT MODE
{

$IMAGE .= '<td style="text-align:left;vertical-align;middle;" onmouseover="this.className=\'border14\';" onmouseout="this.className=\'\';"> '."\n";
$IMAGE .= '<table style="width:100%;"><tr><td style="width:60%;font-size:8pt;" class="color">'."\n";

if (is_int($i / 2))
{
if ($i != $TOTALG) { $newtr = 'class="border13"'; } else { $newtr = ''; }
}
else
{
$newtr = '';
}

if ($b['text'] == '') $b['text'] = "Untitled";
if ($b['gcatagory'] == '') $b['gcatagory'] = "All";

$IMAGE .= ''.$i.'. '.$IMAGELINK .''.$b['text'].'</a> '.$LANG['181'].' '.ulink($b['user']).' '."\n";
$IMAGE .= '</td><td style="width:20%;font-size:8pt;" class="color"> '.ucfirst($b['gcatagory']).' </td>'."\n";
$IMAGE .= '<td style="width:20%;font-size:8pt;" class="color"> '.date("M d, Y",$b['time']).' </td>'."\n";
$IMAGE .= '</tr></table>'."\n";
$IMAGE .= '</td></tr><tr '.$newtr.'>'."\n";

}
elseif ($NUM7 == '3') // INFOPIC MODE
{


$IMAGE .= '<td style="text-align:left;vertical-align;middle;">'."\n";
$IMAGE .= '<table style="width:100%;"><tr><td style="width:30%;text-align:center;">'."\n";

if (is_int($i / 2))
{
if ($i != $TOTALG) { $newtr = 'class="border13"'; } else { $newtr = ''; }
}
else
{
$newtr = '';
}

$IMAGE .= $IMAGE2;

if ($b['text'] == '') $b['text'] = "Untitled";
if ($b['gcatagory'] == '') $b['gcatagory'] = "All";


$IMAGE .= '</td><td style="width:70%;vertical-align:top;font-size:8pt;" class="color"> asd'."\n";

$newwidth = "";
$newheight = "";



$IMAGE .= '<b>'.$LANG['172'].'</b>: '.ulink($b['user']).' <br />'."\n";


$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG[183].'</b>: '.$b['text'].' </div>'."\n";
$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG['173'].'</b>: '.$b['view'].' </div>'."\n";
$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG['175'].'</b>: '.$b['comment'].' </div>'."\n";



if (file_exists("".$VAR[5]."/".$img2."")) {

list($newwidth, $newheight) = @getimagesize("".$VAR[5]."/".$img2."");

$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG['182'].'</b>: '.$newwidth.'x'.$newheight.' </div>'."\n";
$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG['184'].'</b>: '.newsize(filesize("".$VAR[5]."/".$img2."")).' </div>'."\n";

}


$IMAGE .= '<div style="padding-top:4px;"><b>'.$LANG['185'].'</b>: <div style="padding:4px;"><input type="text" size="70" name="url" value="'.$ilocation.'" /></div></div>'."\n";



$IMAGE .= '</td></tr></table>'."\n";
$IMAGE .= '</td></tr><tr '.$newtr.'>'."\n";


}
else // MAIN GALLERY MODE
{


$IMAGE .= '<td style="text-align:center;vertical-align;middle;"> '."\n";
$IMAGE .= '<table style="margin-left:auto;margin-right:auto;"><tr><td style="font-size:8pt;" class="color">'."\n";

$IMAGE .= $IMAGE2;

if (member_types2($VAR[4]) == '0') {

$IMAGE .= '<div>[ <a href="'.$VAR[0].'/admin/?action='.base64_encode('delete_image').'&amp;id='.base64_encode($b['id']).'">Delete</a> ] ';

if ($b['feature'] == '1') {

$IMAGE .= '[ <a href="'.$VAR[0].'/admin/?action='.base64_encode('remove_feature_image').'&amp;id='.base64_encode($b['id']).'&amp;return='.base64_encode($VAR[3]).'">Remove Feature</a> ]';

} else {

$IMAGE .= '[ <a href="'.$VAR[0].'/admin/?action='.base64_encode('feature_image').'&amp;id='.base64_encode($b['id']).'&amp;return='.base64_encode($VAR[3]).'">Feature</a> ]';

}

$IMAGE .= '</div>';


}


$IMAGE .= "</td>\n</tr>\n</table></td>\n".$tr."\n";



} // END IMAGE MODE

Share this post


Link to post
Share on other sites
Cripes. Do I have to read all that!!

If I did, I'd see that the very same chunk of html you're looking for is buried near the bottom:

[code]    $IMAGE .= '<div style="padding-top:4px;">'.$LANG['185'].': <div style="padding:4px;"><input type="text" size="70" name="url" value="'.$ilocation.'" /></div></div>'."\n";[/code]

So it looks as if the full URL for the image is $ilocation.  And if that's right, then the message you want to send to your friend is something like:

[code]echo "See my fabulous picture at ". $ilocation;[/code]

Share this post


Link to post
Share on other sites
hi andy now i need to add this in to my send page to friend script below where will it need to go exactly?

[quote author=lounger link=topic=106569.msg426625#msg426625 date=1157218279]
sorry redarrow heres the mail code
thanks in advance -


<!doctype html public "-//w3c//dtd html 3.2//en">

<html>

<head>
<title>(.com)</title>

<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>

<body bgcolor="#330000" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<a href="http://www..com" target="_blank" ><BR><center><img src="http://.com/images/emailpagefriend.jpg" width="800" height="104" border="0" /></a>
<BR>
<BR>
<b>
<?
$status = "OK";
$msg="";
if (!stristr($y_email,"@") OR !stristr($y_email,".")) { // checking your email
$msg .="Your email address is not correct<BR>";
$status= "NOTOK";}

if (strlen($y_name) <2 ) { // checking your name
$msg .="Please enter your name<BR>";
$status= "NOTOK";}

if (!stristr($f_email,"@") OR !stristr($f_email,".")) { // checking friends email
$msg .="Your Friends address is not correct<BR>";
$status= "NOTOK";}

if (strlen($f_name) <2 ) { // checking freinds name
$msg .="Please enter your friend's name<BR>";
$status= "NOTOK";}

if (strlen($y_msg) <2 ) { // checking Message details
$msg .="Please enter your message details<BR>";
$status= "NOTOK";}


[/quote]

Share this post


Link to post
Share on other sites
or can it go in this bit

[quote author=lounger link=topic=106569.msg426630#msg426630 date=1157218665]
the rest of the code is here http://pastebin.com/782116
[/quote]

Share this post


Link to post
Share on other sites
pastebin appears to have gone to the waste bin. I can't connect to it.  basically what you want to do is change wherever it says something like "please visit the page ". $url to "please look at my picture at ". $ilocation ... give it a try.

Share this post


Link to post
Share on other sites
hi andy i changed it to-

$ref=@$HTTP_REFERER;
/////Message at the top of the page showing the url////
$header_message = "Hi $f_name \n Your friend $y_name requested you to visit the page at $ilocation";
/// Body message prepared with the message entered by the user ////
$body_message =$header_message."\n".$y_msg."\n";

but now there is not a link at all being sent in this email?[

Share this post


Link to post
Share on other sites
for the record this used to read-

$ref=@$HTTP_REFERER;
/////Message at the top of the page showing the url////
$header_message = "Hi $f_name \n Your friend $y_name requested you to visit the page at \n $ref \n";
/// Body message prepared with the message entered by the user ////
$body_message =$header_message."\n".$y_msg."\n";
$body_message .="\n Get your FREE 25MB email address by visiting http://www..com";

Share this post


Link to post
Share on other sites
andy i have got the script working again by also changing-

$ref=@$HTTP_REFERER to $ilocation=@$HTTP_REFERER

but now again the url in the browser is being sent and i have full access to tamper with the account that sent the link?? What am i doing wrong?

Share this post


Link to post
Share on other sites
maybe this $ilocation is not the correct variable after all ...can any one think of anything?

Share this post


Link to post
Share on other sites
My reply - post #31 in this thread - was because based on the code you posted, the only thing I saw that looked like it would generate the html code to show the image was if the variable $ilocation was the image URL.

[quote]$ref=@$HTTP_REFERER to $ilocation=@$HTTP_REFERER [/quote]

[u]Don't do that[/u]. All it does to change the value of $ilocation to the referring page URL - exactly what we're trying to overcome.

Try with a really, really simple email ... or just echo the email content without sending it. Either of those will speed the process.

I still think this ought to work, so change:

[code]$header_message = "Hi $f_name \n Your friend $y_name requested you to visit the page at \n $ref \n";[/code]

to:

[code]$header_message = "Hi $f_name \n Your friend $y_name requested you to visit the page at \n $ref \n";
echo "image location = ". $ilocation;
exit();
[/code]

Share this post


Link to post
Share on other sites
no that did not work either andy once the message is sent i now get this responce-

image location =

and the message does not reach my email add, does this message mean its searching for the image location? thanks in advance andy. :)

Share this post


Link to post
Share on other sites
OK, unchange it back to the way it was. I can't work with these random snippets of code strewn through this thread (it isn't helping you and it's giving me a headache).

Post the complete current code for the script that's supposed to 'send this to your friend' and separately post the script that displays the image where you want to have the 'email this whatever to a friend'. Post them both at pastebin then post the pastebin refs here.

Share this post


Link to post
Share on other sites
sorry if im doing you head in with this one andi i appreciate your help, thankyou

here is the email script-

http://pastebin.com/782934

here is the full page of the gallery php the bit that refers to the variable name is $IMAGE2

http://pastebin.com/782943

Share this post


Link to post
Share on other sites
i just made this for you to understand the concept of sending a profile please copy and past and use it to futher your study.

good luck.

test_result.php

[code]

<?php session_start();

if($_POST['submit']){


$to=$email;

$subject = 'A profile sent to you from a friend';

$message="<html>
<title>members profile</title>
<body>
<h1> members profile for $name</h1>
<br>
<br>
<b>username</b>
<br>
$name
<br>
<b>age</b>
<br>
$age
<br>
<b>members location</b>
<br>
$location
<br>
<b>members description</b>
<br>
$description
<br>
</html>
</body>
";



$headers = "From: Do not email back\r\n" .
      'X-Mailer: PHP/' . phpversion() . "\r\n" .
      "MIME-Version: 1.0\r\n" .
      "Content-Type: text/html; charset=utf-8\r\n" .
      "Content-Transfer-Encoding: 8bit\r\n\r\n";mail($to, $subject, $message, $headers);

echo "profile sent to $email";
}
?>

sending a profile to your friend <?php echo $name ?>

<form method="POST" action="">
<br>
please enter friends email address
<br>
<input type="text" name="email">
<br>
<input type="submit" name="submit" value="send this profile">
<br>
</form>

[/code]


test.php

[code]

<?php session_start();

$name="redarrow";
$age="32";
$location="london";
$description="redarrow loves php";

$name=$_SESSION['name']=$name;
$age=$_SESSION['age']=$age;
$location=$_SESSION['location']=$location;
$description=$_SESSION['description']=$description;

?>

<html>
<title>members profile</title>
<body>
<h1> members profile for <?php echo $name?></h1>
<br>
<br>
<b>username</b>
<br>
<?php echo $name?>
<br>
<b>age</b>
<br>
<?php echo $age ?>
<br>
<b>members location</b>
<br>
<?php echo $location?>
<br>
<b>members description</b>
<br>
<?php echo $description?>
<br>
<br>
<br>
<a href="test_result.php">email profile to friend</a>
</html>
</body>

[/code]

Share this post


Link to post
Share on other sites
as you can see the code i provided is easy to use and modifi hope it helps.

Share this post


Link to post
Share on other sites
redarrow are you suggesting that this code can replace my email code and it will send the image url instead of the browser url?

Share this post


Link to post
Share on other sites
have you tried my code please cheers.

just send the deatails to you own email address and look at the email ok.


once you done that i add a picture to the existing code for an example ok.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.