Basic PHP instructions not working. Please help a newbie...

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

Post Reply
Jerute
Forum Newbie
Posts: 2
Joined: Sat Mar 08, 2008 6:07 am

Basic PHP instructions not working. Please help a newbie...

Post by Jerute »

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:

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);
?>
 
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.
Last edited by Jerute on Sat Mar 08, 2008 7:02 am, edited 1 time in total.
bertfour
Forum Commoner
Posts: 45
Joined: Fri Mar 07, 2008 7:33 am

Re: Basic PHP instructions not working. Please help a newbie...

Post by bertfour »

Look in your php.ini maybe functions are disabled?

"disable_functions"
Jerute
Forum Newbie
Posts: 2
Joined: Sat Mar 08, 2008 6:07 am

Re: Basic PHP instructions not working. Please help a newbie...

Post by Jerute »

Hi and tx for answering. Found the line in the php.ini file but it just says

disable_functions =

which I assume means that none are disabled...
bertfour
Forum Commoner
Posts: 45
Joined: Fri Mar 07, 2008 7:33 am

Re: Basic PHP instructions not working. Please help a newbie...

Post by bertfour »

Don't know....

Can't you get anything an screen?

Better ask here maybe:

http://www.wampserver.com/phorum/list.php?2
Post Reply