Current location: Hot Scripts Forums » Programming Languages » PHP » $ in http:// link via email?


$ in http:// link via email?

Reply
  #1 (permalink)  
Old 01-13-04, 02:35 PM
GG Dart's Avatar
GG Dart GG Dart is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
$ in http:// link via email?

hi
i made a php script with a activation link. but i can't get the variable to show when the link gets sent via email.
the hole thing works so:
1. user puts in data
2. data gets writen in database setting $acountactiv to NULL
3. user gets email with activations link to set $acountactivation to yes

now the problem:

<?php
include("config.php");
$abfrage = mysql_query ("FETCH idx FROM login WHERE userx = '$userx'");
$subjekt = "account activation";
$message = "Your activations link is:
http://blabla.com/activ.php?idx=$idx&accoutactiv=yes";
$from = "xxx";
$from1 = "xxx";
mail($email, $subjekt, $message, "From: $from <$from1>");
?>

email comes this way:
Your activations link is:
http://blabla.com/activ.php?idx=&accoutactiv=yes

but it should come:
Your activations link is:
http://blabla.com/activ.php?idx=$idx=123(or whatever)&accoutactiv=yes

i tried SELECT for FETCH
$userx is declared further up in the script

Have i to change the $message = "......." syntax ?
Reply With Quote
  #2 (permalink)  
Old 01-13-04, 04:36 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
I think you need a bit more added after your query, befire you start your mail functions.
PHP Code:

connect to database...
$abfrage mysql_query ("SELECT idx FROM login WHERE userx = '$userx'");
$result=mysql_query($query);
$num mysql_num_rows($result);
if(
mysql_num_rows($result) == 0){ 
        echo(
"No Results"); 
    } 
  else
   {
while(
$row mysql_fetch_array($result))
{
$idx $row[idx];
echo 
'$idx';
}
If 
you result is displayedadd your mail functions here and test it.

I havent tested this, but give it a try and see what happens.
Reply With Quote
  #3 (permalink)  
Old 01-15-04, 11:23 AM
dawson_davis's Avatar
dawson_davis dawson_davis is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Maine
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I have had some problems in the past with variables being properly passed into strings. I'm not sure what caused it, but I do know what fixed it.

PHP Code:



$add 
"with";
$string  "This is a string " .$add" extra stuff added";
echo 
$string;
//will be displayed as 
//This is a string with extra stuff added. 
__________________
Dawson Davis
ASP Newbie

2b||!2b
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a table or variable through a link? chinablack1480 PHP 1 12-07-03 03:55 AM
Bidflux Blackadder General HotScripts Site Discussion 10 11-08-03 12:49 PM
Form to database to email BogoMips ASP 0 11-03-03 06:12 AM
Different type of link counter mdhall Script Requests 2 10-10-03 01:19 PM
Preventing email form abuse LunarOrbit Perl 3 10-04-03 09:55 PM


All times are GMT -5. The time now is 08:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.