Page 1 of 1

PHP Uploader Script Doesn't Work - Please Help

Posted: Sun Jun 03, 2007 1:49 pm
by ashfordlive
I have a PHP email form on my website that doesn't work. This is the codebase that I was given a couple of weeks ago. I had it done through a paid coder, but now I've paid, I can't get hold of him. The ZIP file is located on my server at http://ashfordlive.789mb.com/external/phpform.zip. If anyone can lend me a hand, this would be greatly appreciated.

Posted: Sun Jun 03, 2007 1:58 pm
by galbus
well for a start it has been created assuming register_globals is on.

Try changing form.php to this:

Code: Select all

$action = null;
if (isset($_REQUEST['action'])) {
  $action = $_REQUEST['action'];
}

switch ($action) {
  case "send":
    sendMail();
    showForm();
    break;
  default:
    showForm();
}

PHP Uploader

Posted: Sun Jun 03, 2007 2:23 pm
by ashfordlive
I have tried the solution that you have suggested, and I get this problem when I visit the address in my browser. (Image insert doesn't work, so please click the link).

http://www.hotlinkfiles.com/files/58478 ... ormphp.bmp

Any other suggestions?

Posted: Sun Jun 03, 2007 2:30 pm
by John Cartwright
Did you wrap your code in php tags?

Posted: Sun Jun 03, 2007 2:31 pm
by galbus
you don't have PHP running on your web server! :lol:

Edit: haha or maybe you missed off the <?php and ?> opening and closing tags. sorry, i thought you'd put them in automatically. :wink:

Posted: Sun Jun 03, 2007 2:34 pm
by ashfordlive
I have PHP 5 on the server, but I forgot to insert the PHP tags, could you remind me how to do this, or even better, repost the code with the tags? Thanks very much.

Posted: Sun Jun 03, 2007 2:37 pm
by galbus

Code: Select all

<?php

$action = null;
if (isset($_REQUEST['action'])) {
  $action = $_REQUEST['action'];
}

switch ($action) {
  case "send":
    sendMail();
    showForm();
    break;
  default:
    showForm();
} 

?>

Posted: Sun Jun 03, 2007 2:38 pm
by ashfordlive
I have uploaded the file again with the tags included, and I get this error.

Fatal error: Call to undefined function showForm() in /www/789mb.com/a/s/h/ashfordlive/htdocs/form.php on line 13

Do you have any other suggestions, and as a footnote, my server has PHP 5.

Posted: Sun Jun 03, 2007 2:40 pm
by galbus

Code: Select all

<?php

require('uploader.php');

$action = null;
if (isset($_REQUEST['action'])) {
  $action = $_REQUEST['action'];
}

switch ($action) {
  case "send":
    sendMail();
    showForm();
    break;
  default:
    showForm();
}

?>
And make sure the uploader.php file is in the same folder.

We'll get there in the end :wink:

Posted: Sun Jun 03, 2007 2:50 pm
by feyd
I'm not entirely sure why this was unlocked, it shouldn't have been.

Locked again.