Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,593 members, 7,809,151 topics. Date: Friday, 26 April 2024 at 01:30 AM

I Need Help With This! - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / I Need Help With This! (988 Views)

(2) (3) (4)

(1) (Reply) (Go Down)

I Need Help With This! by trips(m): 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(m): 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)

My New Blog Site / R.i.f - Richinvestmentfund.com / Webdesign : Can You Do It All?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.