Jump to content


Photo

Re: send page to friends help please


  • Please log in to reply
58 replies to this topic

#41 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 September 2006 - 07:33 PM

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.

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


Don't do that. 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:

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

to:

$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();

Legend has it that reading the manual never killed anyone.
My site

#42 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 07:48 PM

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. :)

#43 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 September 2006 - 07:59 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#44 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 08:15 PM

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

#45 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 08:20 PM

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


<?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>



test.php


<?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>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#46 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 08:44 PM

ok redarrow i will study this, andy did you get the code from pastebin?

#47 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 08:53 PM

as you can see the code i provided is easy to use and modifi hope it helps.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#48 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 08:56 PM

redarrow are you suggesting that this code can replace my email code and it will send the image url instead of the browser url?

#49 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 09:18 PM

hi andy did you get a chance to look at the code yet?

#50 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 09:25 PM

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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#51 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 09:41 PM

this will show the user profile and a img to the users email account.

copy and past to test

test_result.php


<?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>
<br>
$name likes this logo
<br>
<img src='http://www.google.co.uk/intl/en_ALL/images/images_hp.gif'></img>
</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>



test.php


<?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>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#52 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 09:52 PM

hi redarrow i tried the code but it leaves my gallery page blank? is there not a way i can just adapt the send page to friends script that i have posted in pastebin as i already have this script on my website and it works great except for sendind the wrong url?

#53 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 09:58 PM

you have to save the two pages i posted as seprate pages test.php and test_result.php in the root directory and dont alter them.

point you browser to the test.php then your see a profile with a link to send the profile to a email address you then goto test_result.php and then you emter your email address and then you get the profile what is set in the meesage varable on the mail code your also see an image that is from google try it works grate.

when you got it going add it to your existing code and change what needs to be changed that easy.

your existing code has got lot off flaws in it so you need to redesign it and this code that i have provided should do the trick trust me ok.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#54 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 10:12 PM

hi redarrow i have this on my server and your right it works i get the google image but i need it to send a pic from my gallery section which has around 300 images in it how do i get it to do this for each image?

#55 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 10:14 PM

you need to send them all at once to show in the email
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#56 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 10:16 PM

you mean i have to send all the images at once?

#57 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 10:23 PM

i think your idear is inpossable as your email account will get ban 1 pic ok but 300 bad idear sorry.

the best solution is to provide a link in the email to view the pics ok.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#58 lounger

lounger
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 10:28 PM

i dont think you understand what i am saying i only need the script to send 1 pic at a time, but will it be able to send each pic on every page by picking up the image url or do i need to manually enter the image url myself for each pic?

#59 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 September 2006 - 10:35 PM

somethink like this ok.

the id will be the members id and in the image database each image should have that users id to get that image ok also in the query limit it to 1 incase there more then one so the email only gets one ok..

you need to setup the database entrys and the select statement and then try to display a users image with this code below before we go any futher.

when you got that going then we can add it to the code i posted but not untill then ok.
<?php session_start();

// we need session start at the top of page to get the users id

// need database connection information

$db=mysql_connect("localhost" "xxxxxx","xxxxxx");

// need the correct database to use
mysql_select_db("xxxxx",$db);

// need to select the database that holds the images
$query="select * from xxxxxx where id='$id' limit 1";

// query the query
$result=mysql_query($query);

// a while loop to get the images from the database while loop set to $image
while($image=mysql_fetch_assoc($result)){

// set image to the while loop the xxxx is the name of the database field that the select statement resides
$image=$image['xxxx'];

//make a friendly link to get the images
$image_link="<img src='myurl/folder/$image'></img>";

//echo the image out but only one
echo $image_link
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users