Basic PHP instructions not working. Please help a newbie...
Posted: Sat Mar 08, 2008 6:16 am
Hi all and tx in advance. I'm fairly new to PHP and have looked for the answer to this question but to no avail...
I am running WAMPSERVER 2.0 on Windows XP Professional SP2. I'm having trouble with a couple of PHP instructions.
I know some of them are working fine because I have a contact form using PHP to send the mail and this works fine:
However...
I'm trying simple instructions that aren't working, like this...
<?php
phpinfo();
?>
...and this doesn't work. I just get a blank screen. I've also found that the print() instruction doesn't work.
Am I being blonde? Can anybody out there help me please?
Yours, confused.
I am running WAMPSERVER 2.0 on Windows XP Professional SP2. I'm having trouble with a couple of PHP instructions.
I know some of them are working fine because I have a contact form using PHP to send the mail and this works fine:
Code: Select all
<?php
$conname = $_POST['conname'];
$conmail = $_POST['conmail'];
$conphone = $_POST['conphone'];
$conmessage = $_POST['conmessage'];
if(!$conmail == "" && (!strstr($conmail,"@") || !strstr($conmail,".")))
{
echo "Please enter a valid email address.\n";
die ("Try again.");
}
if (eregi('http:', $conmessage)) {
die ("You may not post links in the message section.");
}
if(empty($conname) || empty($conmail) || empty($conmessage )) {
echo "All fields must be completed.\n";
die ("Try again.");
}
$conmessage = stripcslashes($conmessage);
$subject = "Enquiry form completed";
$from = "From: $conmail\r\n";
$message = "Phone: $conphone \n
$conmessage \n";
mail("my address@wherever.co.uk", $subject, $message, $from);
?>
I'm trying simple instructions that aren't working, like this...
<?php
phpinfo();
?>
...and this doesn't work. I just get a blank screen. I've also found that the print() instruction doesn't work.
Am I being blonde? Can anybody out there help me please?
Yours, confused.