LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2008, 06:20 PM   #1
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
Apache php error


Its probably a PEBKAC problem, but here's what I got.

When you go to my site (currently no domain name), you see this.

Now, if you try and submit something via that form, you see a problem. It forwards you to edmanemail.php...which doesn't do anything.

What do I need to do to make it work?

contact.html is:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
        <head>
        <meta http-equiv="Content-Type" content="text/html;
        charset=utf-8"/>
        </head>

        <title>Contact Me</title>

        <body>
                <form method="POST" action="edmanmail.php">
                        <textarea name="message" cols="50" rows="5"></textarea>
                        <br>
                        <br>
                        <input type="submit" value="Submit">
                </form>
        </body>
</html>
edmanmail.php is:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
        <head>
                <title>
                        Sending email...
                </title>
        </head>

        <body>
                <center>
                <h1>
                        Your email has been sent.
                </h1>
                <?php
                        $result = mail(myemail@yahoo.com), "Web Mail",
                                $_request["message"]);
                ?>
                </center>
        </body>
</html>
httpd.conf file is here.

And yes, I know there is very little security at this point, but I'm worried about functionality right now.

Last edited by phantom_cyph; 03-17-2008 at 06:37 PM.
 
Old 03-17-2008, 07:12 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Since it's a PHP file that isn't being displayed, can you also post /etc/apache/mod_php.conf please?
 
Old 03-17-2008, 07:50 PM   #3
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472

Original Poster
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
I haven't done anything with this file, but here it is.
 
Old 03-18-2008, 12:04 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Check /var/log/httpd/error_log for errors

$_request["message"]; might have to be single quotes (I always use single quotes in arrays)
and you have two ')' in the mail command, so I'm sure you will find something in the above error log

PS This does not sound like a networking question to me

Last edited by Wim Sturkenboom; 03-18-2008 at 12:09 AM. Reason: Added PS
 
Old 03-18-2008, 03:18 PM   #5
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472

Original Poster
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
Ok, here is my edmanmail.php now:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
        <head>
                <title>
                        Sending email...
                </title>
        </head>

        <body>
                <center>
                <h1>
                        Your email has been sent.
                </h1>
                <?php
                        $result = mail("fluxnuk3r@yahoo.com", "WebMail",
                                $_request["message"]);
                ?>
                </center>
        </body>
</html>
The problem is, I don't get any mail. How long should it take? And who will it "be from"?
 
Old 03-18-2008, 04:43 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
nothing to do with networking. moved to Programming.
 
Old 03-18-2008, 07:04 PM   #7
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472

Original Poster
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by acid_kewpie View Post
nothing to do with networking. moved to Programming.
Understood. Hopefully its figured out though...because I have no idea.
 
Old 03-19-2008, 03:51 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

You need to change $_request["message"] to $_REQUEST["message"] since variable names are case sensitive in PHP. But still, your code should have sent an empty email. Perhaps some spam filter at Yahoo took it? You can look in the file /var/log/mail.log for information about what happened.
 
Old 03-19-2008, 10:20 AM   #9
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472

Original Poster
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
Still not working so well...

What is the best mail service to use with this? I tried to use gmail, but to no avail.

Do I need to somehow set up my mail accout to allow it?
 
Old 03-21-2008, 01:35 PM   #10
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi again

You need to set up the box so it can send email - so you need a MTA. It might be easier to find the error by using the mail command - if it doesn't work, the PHP mail command will not work.

Do you see anything in mail log?
 
Old 03-21-2008, 01:59 PM   #11
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: The Tropics
Distribution: Slackware & Derivatives
Posts: 2,472

Original Poster
Blog Entries: 1

Rep: Reputation: 128Reputation: 128
Its trying to send mail now, evidently the problem is that I need to buy a domain name, so I'm working on it now. Gmail and Yahoo! don't accept "raw IPs".
 
Old 03-24-2008, 04:28 PM   #12
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Why not ask the ISP for the name of their SMTP server? Then setup your MTA with that as a smarthost.

Last edited by Guttorm; 03-24-2008 at 04:29 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache and PHP compile error rnturn SUSE / openSUSE 2 06-29-2007 09:42 PM
Sablotron+iconv+php+apache error MPowers Linux - Software 0 03-02-2006 02:27 AM
Apache Virtualhosts + PHP error critical Linux - Software 3 08-03-2005 12:21 AM
Apache + PHP error Peper Linux - Software 1 12-20-2004 09:27 AM
apache + php error bkortleven Linux - Software 2 04-23-2003 03:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration