Php doesn't work for me, I've tried a simple HelloWorld.php script and I'm just getting a blank page in my browser.
The file is saved in the correct directory (file:///C:/xampp/htdocs/mystuffchris/helloWorld.php) as far as I know.
The code used is...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Hello World</title> </head> <body> <p><?php echo "Hello World"; ?></p> </body> </hmtl> I've also tried using Php with a Html form with action="borderMaker.php". Here's borderMaker.php sourcecode... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Your Output</title> </head> <body> <h1>Your Output</h1> <div style = "text-align: center"> <?php //retrieve all the variables $basicText = filter_input(INPUT_POST, "basicText"); $borderSize = filter_input(INPUT_POST, "borderSize"); $sizeType = filter_input(INPUT_POST, "sizeType"); $borderStyle = filter_input(INPUT_POST, "borderStyle"); $theStyle = <<<HERE "border-width:$borderSize$sizeType; border-style:$borderStyle; border-color:green" HERE; print "<div style = $theStyle>"; print $basicText; print "</div>"; ?> </div> </body> </html>
When I use the Html form and click the Submit button I just get text in the browser like this...
YOUR OUTPUT
";print $basicText;print "
"; ?>
The files are saved with the correct extensions. I have tried using Firefox and Internet Explorer, tried both Xampp and Wampserver, my browser just won't recognise the Php.
I know this is a log post for what I suspect is a real Noob problem but I'd be really greatful of any advice, thanks.
EDITED BY akitchin: please use code tags in future postings.




This topic is locked







