NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Np$ 50 for resolving issue.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-16-2006, 11:48 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




Np$ 50 for resolving issue.


keep getting this error message:


Warning: mail(): SMTP server response: 554 Error: no valid recipients in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 25


anyone help me?
Np$ 50 for resolving issue.

cheers
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-16-2006, 11:51 AM   #2 (permalink)
Senior Member
 
Xyzer's Avatar
Join Date: Aug 2005
Location: United Kindom
Posts: 1,502
Xyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to all
 


Tsunami Relief AIDS/HIV
Im ready to help, can you please paste the document code? thanks
Xyzer is offline  
Old 05-17-2006, 01:48 AM THREAD STARTER               #3 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




the problem is this is a .php page that calls three other .php pages.

so not quite sure what page to paste.

what do you think?
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-17-2006, 01:59 AM   #4 (permalink)
NamePros Legend
 
weblord's Avatar
Join Date: Dec 2005
Location: Philippines - www.Nabaza.com
Posts: 19,785
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
 


Autism Protect Our Planet
pls paste this page: e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php

i see whats on line 25
__________________
Nabaza.com - Amaia
weblord is offline  
Old 05-17-2006, 02:30 AM   #5 (permalink)
New Member
Join Date: May 2006
Posts: 2
chang21 is an unknown quantity at this point
 



Can u send me the email.php , the error code seem like authentication issue. my email is andychang21@gmail.com
chang21 is offline  
Old 05-17-2006, 04:02 AM THREAD STARTER               #6 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




hi, ths is the email.php

<?
require_once("conn.php");
require_once("includes.php");

//get the agent info
$q1 = "select * from re2_agents where AgentID = '$_GET[AgentID]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);

if(isset($_POST[s1]))
{
$to = $a1[email];
$subject = $_POST[subject];
$message = $_POST[message];
$message .= "\n\nProperty:\n$site_url/info.php?id=$_GET[ListingID]\n\n";

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_POST[u_name] <$_POST[u_email]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";

mail($to, $subject, $message, $headers);
????: NamePros.com http://www.namepros.com/programming/197931-np-50-for-resolving-issue.html

$thankyou = "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"$site_url/info.php?id=$_GET[ListingID]\">back to the property details</a></center>";


//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/EmailThankyouTemplate.php");
require_once("templates/FooterTemplate.php");

}


$AgentName = "$a1[FirstName] $a1[LastName]";

if(!empty($_GET[ListingID]))
{
$SubjectLine = "Property ID $_GET[ListingID]";
}


//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/EmailTemplate.php");
require_once("templates/FooterTemplate.php");

?>

this is the emailtemplate.php what the above code request.

<script>
function CheckMail() {

if(document.je.u_name.value=="")
{
alert('Enter your name, please!');
document.je.u_name.focus();
return false;
}

if(document.je.u_email.value=="")
{
alert('Enter your email, please!');
document.je.u_email.focus();
return false;
}

if(document.je.subject.value=="")
{
alert('Enter the subject, please!');
document.je.subject.focus();
return false;
}
????: NamePros.com http://www.namepros.com/showthread.php?t=197931

if(document.je.message.value=="")
{
alert('Enter your message, please!');
document.je.message.focus();
return false;
}

}
</script>

<br><br>
<form method=post onsubmit="return CheckMail();" name=je>
<table width=340 align=center border=0>
<caption align=center><span style="font-size:11; font-family:verdana; color:black; font-weight:bold">Use this form to contact <?=$AgentName?></span></caption>

<tr>
<td>Name:</td>
<td><input type=text name="u_name" size=42 class="mtext"></td>
</tr>

<tr>
<td>Email:</td>
<td><input type=text name=u_email size=42 class="mtext"></td>
</tr>

<tr>
<td>Subject:</td>
<td><input type=text name=subject size=42 class="mtext" value="<?=$SubjectLine?>"></td>
</tr>

<tr>
<td valign=top>Message:</td>
<td><textarea rows=6 cols=41 name=message class="mtext"><?=$_POST[message]?></textarea></td>
</tr>

<tr>
<td>&nbsp;</td>

<td>
<input type=submit name=s1 value="Send" class="sub1">
</td>
</tr>

</table>
</form>
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
Last edited by fried-chicken; 05-17-2006 at 04:06 AM.
fried-chicken is offline  
Old 05-17-2006, 04:43 AM   #7 (permalink)
Senior Member
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,154
aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough
 



it is possible that the email is not valid. Try echoing out $q1, and put it into phpmyadmin to see if anything gets returned. If nothing gets returned, it's your query's problem, and not the mail code or anything.
__________________
If you're as bored as I am, join me in Fallensword!
(I swear, this game is actually pretty fun :P)
aznchong91 is offline  
Old 05-17-2006, 04:52 AM THREAD STARTER               #8 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




yeah i'll give it a go.

any chance you can explain clearer, never touch script codes before.

cheers
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-17-2006, 04:57 AM   #9 (permalink)
Senior Member
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,154
aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough
 



ok, never mind, let me try a different approach. After $a1 = mysql_fetch_array($r1);, but echo $a1[email]; if it returns a blank, there's a problem with your query. if it returns an email, I'll have to think a little bit longer. is this ok with you?
__________________
If you're as bored as I am, join me in Fallensword!
(I swear, this game is actually pretty fun :P)
aznchong91 is offline  
Old 05-17-2006, 05:14 AM   #10 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,552
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
Most likely the E-mail you are trying to send to is not set/invalid.
Echo it to check.
Also use quotes when accessing array elements:

$to = $a1[email]; => $to = $a1["email"];
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is offline  
Old 05-17-2006, 05:42 AM   #11 (permalink)
Senior Member
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,154
aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough
 



^ yes, I was also about to suggest that. I normally use single quotes though, ' .
__________________
If you're as bored as I am, join me in Fallensword!
(I swear, this game is actually pretty fun :P)
aznchong91 is offline  
Old 05-17-2006, 07:03 AM THREAD STARTER               #12 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




EDITED like suggestions no joy.
did i put it in the right place?

-------------------------------

<?
require_once("conn.php");
require_once("includes.php");

//get the agent info
$q1 = "select * from re2_agents where AgentID = '$_GET[AgentID]' ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);

echo $a1[email];

if(isset($_POST[s1]))
{
$to = $a1[email];
$subject = $_POST[subject];
$message = $_POST[message];
$message .= "\n\nProperty:\n$site_url/info.php?id=$_GET[ListingID]\n\n";

$headers = "MIME-Version: 1.0\n";
????: NamePros.com http://www.namepros.com/showthread.php?t=197931
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_POST[u_name] <$_POST[u_email]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";

mail($to, $subject, $message, $headers);

$thankyou = "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"$site_url/info.php?id=$_GET[ListingID]\">back to the property details</a></center>";

-----------------


tried with and with out " " and ' ' around [mail]
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-17-2006, 07:11 AM   #13 (permalink)
Senior Member
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,154
aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough
 



did you do '[mail]' or ['mail']?

o yea, and what did it output? anything new?
__________________
If you're as bored as I am, join me in Fallensword!
(I swear, this game is actually pretty fun :P)
aznchong91 is offline  
Old 05-17-2006, 07:47 AM THREAD STARTER               #14 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




hi i did

['mail']

it change to

Warning: mail(): SMTP server response: 554 Error: no valid recipients in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 27


the line error moved dome to line 27
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-17-2006, 07:49 AM   #15 (permalink)
Senior Member
Join Date: Nov 2005
Location: Hong Kong
Posts: 1,154
aznchong91 is a jewel in the roughaznchong91 is a jewel in the roughaznchong91 is a jewel in the rough
 



ok, yea, that didn't change...

just to make sure, comment out the line that says mail($to, ...etc...). just put // in front of it, and change echo $a1[email]; to echo $a1['email'].
__________________
If you're as bored as I am, join me in Fallensword!
(I swear, this game is actually pretty fun :P)
aznchong91 is offline  
Old 05-17-2006, 04:18 PM   #16 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Originally Posted by fried-chicken
EDITED like suggestions no joy.
did i put it in the right place?
It did nothing??? it didn't echo anything?

where you have
PHP Code:
echo $a1[email]; 
change it to:
PHP Code:
if(!isset($a1['email']) || empty($a1['email'])){
  echo 
"something wrong";
????: NamePros.com http://www.namepros.com/showthread.php?t=197931
}
else{
  echo 
$a1['email'];

run the script and tell us what it says now
PoorDoggie is offline  
Old 05-18-2006, 02:06 AM THREAD STARTER               #17 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




hi, done the changes you both said.

the change suggested by "poordoogie"

------------------------------------------

now as soon as you go on to the contacts page it reads "something wrong" in the top right hand corner. without trying to use the formtomail. once used it come up with a similar error as before.

the change suggested by "anzchong91"
????: NamePros.com http://www.namepros.com/showthread.php?t=197931

---------------------------------------

gives "Parse error: parse error, unexpected T_IF, expecting ',' or ';' in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 13"
by going to the contact page and not trying to use the formtomail. nothing else loads on the page.

script still on "anzchong91" suggestion, result can be seen at

www.cheap-florida-holiday.com/email.php
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-18-2006, 02:06 PM   #18 (permalink)
NamePros Regular
 
cvxdes's Avatar
Join Date: Oct 2005
Location: Milford MA
Posts: 692
cvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud ofcvxdes has much to be proud of
 



PHP Code:
<?
require_once("conn.php");
require_once(
"includes.php");

$q1 "SELECT * FROM `re2_agents` WHERE `AgentID` = '".$_GET['AgentID']."' ";
$r1 mysql_query($q1) or die(mysql_error());
$a1 mysql_fetch_array($r1);

if(isset(
$_POST['s1'])){
    
$to $a1['email'];
    
$subject $_POST['subject'];
    
$message $_POST[message];
    
$message .= "Property:\n".$site_url."/info.php?id=".$_GET['ListingID']."\n\n";

    
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
    
$headers .= "Content-Transfer-Encoding: 8bit\n";
    
$headers .= "From: ".$_POST['u_name']." <".$_POST['u_email'].">\n";
????: NamePros.com http://www.namepros.com/showthread.php?t=197931

    if(!@
mail($to$subject$message$headers)){
        echo 
"error";
    }

    
$thankyou "<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href=\"$site_url/info.php?id=$_GET[ListingID]\">back to the property details</a></center>";
    
    require_once(
"templates/HeaderTemplate.php");
????: NamePros.com http://www.namepros.com/showthread.php?t=197931
    require_once(
"templates/EmailThankyouTemplate.php");
    require_once(
"templates/FooterTemplate.php");
}
$AgentName $a1['FirstName']." ".$a1['LastName'];
if(!empty(
$_GET[ListingID])){
    
$SubjectLine "Property ID ".$_GET['ListingID'];
}
require_once(
"templates/HeaderTemplate.php");
require_once(
"templates/EmailTemplate.php");
require_once(
"templates/FooterTemplate.php");

?>
cvxdes is offline  
Old 05-19-2006, 03:56 AM THREAD STARTER               #19 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




hi,
cvxdes. just tried your suggestion. the page loads fine, but when you presss send in the form a small " error " comes up in the top left corner.

cheers
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-19-2006, 12:15 PM   #20 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



are you sure your server is properly configured to send mail?

ps: what does the "@" sign before the mail() function do?
PoorDoggie is offline  
Old 05-19-2006, 12:24 PM   #21 (permalink)
Senior Member
 
Constantin's Avatar
Join Date: Jan 2006
Posts: 1,130
Constantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud ofConstantin has much to be proud of
 



Originally Posted by PoorDoggie
ps: what does the "@" sign before the mail() function do?
@ in front of a PHP function supress any error returned by the function.
Constantin is offline  
Old 05-19-2006, 12:53 PM   #22 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Made a few changes:
PHP Code:
<?

require_once("conn.php");
require_once(
"includes.php");

$q1 mysql_query("SELECT * FROM re2_agents WHERE AgentID = '".intval($_GET['AgentID'])."'") or die(mysql_error());
????: NamePros.com http://www.namepros.com/showthread.php?t=197931
$a1 mysql_fetch_array($q1);

if(isset(
$_POST['s1']))
{
  
$to $a1['email'];
  
$subject $_POST['subject'];
  
$message $_POST['message'];
  
$message .= 'Property:'."\n".$site_url.'/info.php?id='.intval($_GET['ListingID'])."\n\n";

  
$headers .= 'Content-type: text/plain; charset=iso-8859-1'."\r\n";
  
$headers .= 'Content-Transfer-Encoding: 8bit'."\r\n";
  
$headers .= 'From: '.$_POST['u_name'].' <'.$_POST['u_email'].'>'."\r\n";
????: NamePros.com http://www.namepros.com/showthread.php?t=197931

  if(!@
mail($to$subject$message$headers))
  {
    echo 
"error";
  }
  
$thankyou '<center><b><br><br><br>Thank you for your message!<br><br><a class=RedLink href="'.$site_url.'/info.php?id='.intval($_GET['ListingID']).'">back to the property details</a></center>';

  require_once(
"templates/HeaderTemplate.php");
  require_once(
"templates/EmailThankyouTemplate.php");
  require_once(
"templates/FooterTemplate.php");
}

$AgentName $a1['FirstName'].' '.$a1['LastName'];

if(!empty(
intval($_GET['ListingID'])))
{
  
$SubjectLine "Property ID ".intval($_GET['ListingID']);
}

require_once(
"templates/HeaderTemplate.php");
require_once(
"templates/EmailTemplate.php");
require_once(
"templates/FooterTemplate.php");

?>
I'll also point out, you might want to implement some input validation.
Eric is offline  
Old 05-19-2006, 01:20 PM   #23 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Originally Posted by Constantin
@ in front of a PHP function supress any error returned by the function.
oh right so if I were to do @mysql_query($sql) it wouldn't come up with lines of unintelligible text about me having an "error in [my] mysql syntax"?
????: NamePros.com http://www.namepros.com/showthread.php?t=197931

Great, thanks.

Back to the thread
Tom
PoorDoggie is offline  
Old 05-19-2006, 01:33 PM THREAD STARTER               #24 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




i keep getting this error now on page load.

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in e:\domains\c\cheap-florida-holiday.com\user\htdocs\email.php on line 33
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Old 05-23-2006, 02:49 AM THREAD STARTER               #25 (permalink)
NamePros Regular
 
fried-chicken's Avatar
Join Date: Mar 2006
Location: Wigan, UK
Posts: 522
fried-chicken will become famous soon enough
 




bump
__________________
Wigan Web Design | Watches UK | Canvas Pop Art
fried-chicken is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:31 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger