Jump to content

Form comes back completely blank? Help!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
13 replies to this topic

#1
Guest_RyanTuosto_*

Guest_RyanTuosto_*
  • Guests
I have a php form mailer on my site.

When I submit a form, even if i leave the fields blank it returns like this:

Below is the result of your feedback form. It was submitted on Sunday, September 7th, 2008 at 09:15 AM.


Name:

Email:

Company:

etc.

etc.



Basically it returns the form inputs blank.

However this only happens when I fill out the form. It seems I'm getting business on my site but when people fill out the form it comes back only like this:

Below is the result of your feedback form. It was submitted on Sunday, September 7th, 2008 at 09:15 AM.

It tells me that a form was submitted but not even the blank form input categories come back. Even when I leave the form blank I can't recreate this.

Does anybody know whats going on or can help me?

Thanks in advance,
Ryan

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
What's your code?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
Guest_RyanTuosto_*

Guest_RyanTuosto_*
  • Guests
<?PHP 
$to = "my@email.com";
$subject = "New Order"; 
$headers = "http://www.mockup-markup.com"; 
$forward = 0; 
$location = "yoursite.com";
$timestamp = date('Y-m-d_His');
mkdir('/home/content/r/t/u/rtuosto/html/clients/uploads/' . $timestamp);
$target_file = '/home/content/r/t/u/rtuosto/html/clients/uploads/' . $timestamp . '/' . basename($_FILES['file']['name']);

$date = date ("l, F jS, Y"); 
$time = date ("h:i A"); 




$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"; 



if ($_SERVER['REQUEST_METHOD'] == "POST") {
    foreach ($_POST as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}
else {
    foreach ($_GET as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}

mail($to, $subject, $msg, $headers); 
if ($forward == 1) { 
    header ("Location:$location"); 
} 
else { 
} 

if (move_uploaded_file($_FILES['file']['tmp_name'], $target_file)) {
	// Succeeded
	
} else {	
}

?>


#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
How about the HTML? Are you giving each control names?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
Guest_RyanTuosto_*

Guest_RyanTuosto_*
  • Guests
you can view the source at Professional Web Design PSD to XHTML Conversion, W3C Valid Code, CSS Table-less Layouts, SEO Management, XHTML, CSS, XML, RSS, Javascript, JQuery Javasript, SEO Keyword Specialist, SEO Ad Campaign Management, Custom Web Design, WordPress, Joomla, Zen

Everything in the form is named.

The form works properly too, I dont know why I'm getting these completely blank submissions.

#6
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Sorry, I dunno then. :( Keep working at it, you'll get it eventually.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#7
Guest_RyanTuosto_*

Guest_RyanTuosto_*
  • Guests
Well I don't really know anything about php, I just copied the script.

Somebody said it might be somebody trying to use GET method to do something to my site?

I'm not really sure but does that mean anything to you?

#8
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
What does the URL to the PHP script look like? If it has a question mark in it (?) then it's GET.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#9
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
Print the elements from your form to the browser to see if it's getting the right data. I think the server is trying to mail GET data, and your form is sending POST data.

<form action="mailer.php" method="post" id="order" enctype="multipart/form-data">

Check if your getting the correct data by printing to the browser, all of the form data.

#10
Guest_RyanTuosto_*

Guest_RyanTuosto_*
  • Guests
How do I print the elements to my browser?

#11
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
Just use echo.

Like:

<?php
echo $_POST['name'];
?>

This will help you be able to find out if your sending the data, and receiving it properly.

#12
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Or print_r() - PHP: print_r - Manual.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums