PHP Uploader Script Doesn't Work - Please Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked

Is it better to use PHP or CGI in email forms with an attachment?

PHP
2
100%
CGI
0
No votes
 
Total votes: 2

ashfordlive
Forum Newbie
Posts: 8
Joined: Sun Jun 03, 2007 1:13 pm

PHP Uploader Script Doesn't Work - Please Help

Post 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.
galbus
Forum Newbie
Posts: 10
Joined: Sun Jun 03, 2007 1:07 pm

Post 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();
}
ashfordlive
Forum Newbie
Posts: 8
Joined: Sun Jun 03, 2007 1:13 pm

PHP Uploader

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Did you wrap your code in php tags?
galbus
Forum Newbie
Posts: 10
Joined: Sun Jun 03, 2007 1:07 pm

Post 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:
ashfordlive
Forum Newbie
Posts: 8
Joined: Sun Jun 03, 2007 1:13 pm

Post 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.
galbus
Forum Newbie
Posts: 10
Joined: Sun Jun 03, 2007 1:07 pm

Post by galbus »

Code: Select all

<?php

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

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

?>
ashfordlive
Forum Newbie
Posts: 8
Joined: Sun Jun 03, 2007 1:13 pm

Post 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.
galbus
Forum Newbie
Posts: 10
Joined: Sun Jun 03, 2007 1:07 pm

Post 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:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not entirely sure why this was unlocked, it shouldn't have been.

Locked again.
Locked