From php problem

Status
Not open for further replies.

cooro

New Member
Messages
6
Reaction score
0
Points
0
I have a little problem. I´ve done a simple form in php, but it doesn´t work....
the website is this one: http://www.getsuryuu.x10hosting.com/staff.html

the codes are these:

Form Code (html)
HTML:
<form id="form1" name="form1" method="post" action="staff.php">
<p>Nombre:<br />
<label>
<input name="nombre" type="text" id="nombre" />
</label>
<br />
Cargo al que aspiras:<br />
<input name="cargo" type="text" id="cargo" />
<br />
Email:<br />
<input name="email" type="text" id="email" />
<br />

Proyecto en el que quieres trabajar:<br />
<input name="proyecto" type="text" id="proyecto" />
<br />
Comentarios:<br />
<textarea name="mensaje" id="mensaje"></textarea>
<br />
<label>
<input type="submit" name="Submit" value="Enviar Formulario" />
</label>
</p>
</form>

Send (php)

PHP:
<?php

$mail='getsuryuu@gmail.com';


$nombre = $_POST['nombre'];
$cargo = $_POST['cargo'];
$email = $_POST['email'];
$proyecto = $_POST['proyecto'];
$mensaje = $_POST['mensaje'];

$thank="gracias staff.html";

$message = "
nombre:".$nombre."
cargo:".$cargo."
email:".$email."
proyecto:".$proyecto."
mensaje:".$mensaje."";

  if (mail($mail,"form",$message)) 
       Header ("Location: $thank");
  
 ?>

There said that the 21 line is disabled... what should I do?
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
your problem is that mail(); is disabled in basic version PHP, please upgrade to indermediate, Here
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
your problem is that mail(); is disabled in basic version PHP, please upgrade to indermediate, Here

anyways, if you are trying to get that info from a url, you would need to change those $_POST 's to $_GET or $_REQUEST

Second part's not right, look at the html:

<form id="form1" name="form1" method="post" action="staff.php">

method=post, hence he needs to use $_POST to get the data out of the page. Only part that's broken is him not being on intermediate.
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
woops. didnt see that. *edits post*
 

cooro

New Member
Messages
6
Reaction score
0
Points
0
thanks for the help, I´ve already send the request to upgrade my PHP, and I´ll going tho change the post thing
 
Status
Not open for further replies.
Top