PDA

View Full Version : Urgent! PHP help



stu140103
06-02-2004, 05:40 PM
Hello every one

Does any one here know any thing with php???

If they do, could they come on chat F1 http://chatf1.net.nz

As I have a urgent question

Please help me! As I need to fix something ASAP, by the end of tonight!

Megaman
06-02-2004, 05:47 PM
i think "anon" can help on phpbb forum :p

stu140103
06-02-2004, 05:55 PM
> i think "anon" can help on phpbb forum :p

ha ha ha, very funny

I got the script in question working then I stuff something up now something is now not working.

If no one can help me here, can any one tell me a forum, which I can ask this question on?

Part from the phpbb forum.

Megaman
06-02-2004, 05:59 PM
seriously now

i would try the support crew @ phpbb.com

stu140103
06-02-2004, 06:04 PM
Never mind ;) :)

stu140103
06-02-2004, 09:13 PM
First Thanks sal, for what help you could give :)

Now I am still having problems again :(

This is the script:

<?php
$step=$_REQUEST["Submit"];
if($step=="Submit")
{
$name=$_REQUEST["name"];
$address=$_REQUEST["address"];
$suburb=$_REQUEST["suburb"];
$city=$_REQUEST["city"];
$Telephone=$_REQUEST["Telephone"];
$email=$_REQUEST["email"];
$Competition_to_enter=$_REQUEST["Competition_to_enter"];
$msg="";

if($email && $comments)
{
if (mail("doman@doman.co.nz","XLR8 Competitions",$comments,"from:$email"))
{
Header("Location: confirm.htm");
exit;
}
else
{
$msg = "Mail failed.";
}
} else {
$msg .= "You must enter your Name, Address, Suburb, City, Telephone, e-mail Address and Select the Competition you what to enter.";
}

}
?>


Now the problems I have is that not all the info is e-mail to me only the first name, which is unless to me I need the entire form.

Any ideas?

Merlin
07-02-2004, 12:40 AM
Apart from $email, what are you doing with the variables?

And what are $comments?

stu140103
07-02-2004, 12:30 PM
Hello Merlin

It might be that I just got out of bed,

What do you mean ?:| by:

> Apart from $email, what are you doing with the
> variables?
>
>And what are $comments?

Merlin
07-02-2004, 02:50 PM
Exactly that.

Apart from using the email variable in the mail function, none of the other requested variables are posted anywhere.

I can only presume that the comments variable was/is meant to contain all the details previously requested.



The gospel according to Bill GATES:

RULE 1 Life is not fair; get used to it.

RULE 2 The world won't care about your self-esteem. The world will expect you to accomplish something BEFORE you feel good about yourself.

RULE 3 You will NOT make 40 thousand dollars a year right out of high school. You won't be a vice president with a car phone, until you earn both.

RULE 4 If you think your teacher is tough, wait till you get a boss. He doesn't have tenure.

RULE 5 Flipping burgers is not beneath your dignity. Your grandparents had a different word for burger flipping; they called it opportunity.

RULE 6 If you mess up, it's not your parents' fault, so don't whine about your mistakes, learn from them.

RULE 7 Before you were born, your parents weren't as boring as they are now. They got that way from paying your bills, cleaning your clothes and listening to you talk about how cool you are. So before you save the rain forest from the parasites of your parents' generation, try 'delousing' the closet in your own room.

RULE 8 Your school may have done away with winners and losers, but life has not. In some schools they have abolished failing grades; they'll give you as many times as you want to get the right answer. This doesn't bear the slightest resemblance to ANYTHING in real life.

RULE 9 Life is not divided into semesters. You don't get summers off and very few employers are interested in helping you find yourself. Do that on your own time.

RULE 10 Television is NOT real life. In real life people actually have to leave the coffee shop and go to jobs.

RULE 11 Be nice to nerds. Chances are you'll end up working for one.

stu140103
07-02-2004, 04:02 PM
Hello Merlin

Thank you for trying to help me here :)

But now problem solved finely, Thanks to the help of Sal :)

Noel Nosivad
09-02-2004, 03:34 PM
Hi stu140103,

I see you have already solved the problem.

Just a few pointers to point out. $_REQUEST has security issues, so if you know whether the HTML Form's method is GET or POST you should use $_GET or $_POST.

$name = $_POST['name']; use ' (single apostrophe) as to " (double quotes), usually double quotes tells the interpreter that it's interpolated, meaning it's got to do some type of working out to get the value, but in this case it doesn't. This just doesn't put as much stress on the CPU.

There's limited error or security checking within this script. You are not checking whether they entered a correct email address, whether the other information contains any escaped characters.

Check out http://www.dtheatre.com/scripts/formmail for the PHP version of Matt Wright's Perl FormMail http://www.scriptarchive.com/formmail.html.

This will probably be for intermediate/advance php scripters but hopefully it's self explanatory with the comments and easy to configure.

If you need help with anything else just ask.


Noel Nosivad

stu140103
09-02-2004, 03:56 PM
Hello Noel Nosivad

Thank you for your reply

But I am not using the above script any more ;) ( see below)

> Just a few pointers to point out. $_REQUEST has
> security issues, so if you know whether the HTML
> Form's method is GET or POST you should use $_GET or
> $_POST.

As I did not write this script I only coped the above script from one of the other pages on http://www.xlr8online.co.nz/

But I will past that on :)

& I was going to use the above script for this page: http://www.xlr8online.co.nz/competitions/

But sal found me a better script :)