₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,437 members, 8,421,999 topics. Date: Sunday, 07 June 2026 at 01:16 PM

Toggle theme

I Need Help With This! - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersI Need Help With This! (1084 Views)

1 Reply (Go Down)

I Need Help With This! by trips(op): 2:45pm On Jan 10, 2007
Is there anyone good in PHP out there?
I wrote this program for a contact page i built but it doesn't work.
It doesn't get to the feedback,
can anyone there help me out?


<?php

$nam = $_REQUEST["1"];
$mail = $_REQUEST["2"];
$cel = $_REQUEST["3"];
$tel = $_REQUEST["4"];
$messag = $_REQUEST["5"];



$to = "info@mapit.com.ng";
$subject = "Enquiry";
$body = "Name : ".$nam." \n Email Address : ".$mail." \n Cellular : ".$cel." \n Telephone : ".$tel." \n Question : ".$messag." ";
$headers = "From: info@mapit.com.ng\n";

mail($to,$subject,$body,$headers);
echo " Message has been sent succesfully.";


?>


please i need help ASAP,
Thanks!!!
Re: I Need Help With This! by my2cents(m): 4:33am On Jan 11, 2007
by "doesn't get back to the feedback", do u mean it doesnt take u to that page upon successful mail send?

if so, the following may help:
1) Check the page (unless u r using php_self) in the action attribute of ur form tag
2) don't just call the mail function, put some conditionals around it (if(mail) "mail sent" else "problem sending"wink. this will help with debugging

Also in general, try to avoid (unless u r just doing this here to cut on typing) naming variables 1, 2, 3, 4, Use meaningful names. Chances r that if you come back to ur code 6 months from now, it will look like gibberish, even to u as the author.

I hope this helps
Re: I Need Help With This! by Afam(m): 11:48am On Jan 11, 2007
trips:
Is there anyone good in PHP out there?
I wrote this program for a contact page i built but it doesn't work.
It doesn't get to the feedback,
can anyone there help me out?


<?php

$nam = $_REQUEST["1"];
$mail = $_REQUEST["2"];
$cel = $_REQUEST["3"];
$tel = $_REQUEST["4"];
$messag = $_REQUEST["5"];
I suggest you make use of the actual request method as in $_Get[''] or $_POST[''] as the general $_REQUEST[''] may not be parsed properly depending on the parser.

Also use names and not just numbers in naming your variable holders as pointed out by My2cents.

trips:
$to = "info@mapit.com.ng";
$subject = "Enquiry";
$body = "Name : ".$nam." \n Email Address : ".$mail." \n Cellular : ".$cel." \n Telephone : ".$tel." \n Question : ".$messag." ";
$headers = "From: info@mapit.com.ng\n";

mail($to,$subject,$body,$headers);
echo " Message has been sent succesfully.";


?>


please i need help ASAP,
Thanks!!!
Why do you have the dots in the variables in bold? What do you want to achieve? Take time to understand how statements are structured with proper understanding of what any feature you may want to use does before using it.
Re: I Need Help With This! by trips(op): 10:36am On Jan 12, 2007
got your messages,
thanks a lot guys
will try them out and get back to you
Re: I Need Help With This! by markdan1: 9:27am On Jul 23, 2009
i will not like to say any thing here but if you can solve the problem free to contact me on browserplanet@yahoo.com Or check it out on www.browserplanet.ning.com
Re: I Need Help With This! by segsalerty(m): 2:55pm On Jul 23, 2009
@mark dan
if you wan help , why not help here?
abi ?
1 Reply

234

FREE WEBSITE DESIGN TRAINING (CSS, HTML, PHP and MYSQL)I Want To Sell This Site: Www.afcononline.com (a Social Network Like Facebook)I Can Write Articles On Any Topic.