Forum Moderators: coopster

Message Too Old, No Replies

Server/configuration issue or coding issue?

         

amarh21

4:27 am on Dec 31, 2011 (gmt 0)

10+ Year Member



Hi,

This is my first post in these forums so just tell me if I do or say anything wrong :)

I was going along developing my site in Aptana Studio 3 and I was previewing the pages. On the register page of my site there is a snippet of PHP code before the <!DOCTYPE> declaration of the page. For some reason, just a little bit of that code displays when previewing, but none of the actual page content appears. This is the snippet is:

<?php

require_once("/include/membersite_config.php");

if(isset($_POST['submitted']))
{
if($fgmembersite->RegisterUser())
{
$fgmembersite->RedirectToURL("thank-you.html");
}
}
?>


And this is what appears when previewing through firefox:

RegisterUser()) { $fgmembersite->RedirectToURL("thank-you.html"); } } ?>


Just that and a white background.

Any Ideas why? Is it a problem the PHP server being configured incorrectly? Or a problem with the code?

Kind Regards,
Amar

penders

10:09 am on Dec 31, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi Amar, welcome to WebmasterWorld...

Your page isn't being processed by PHP, hence the strange output. Either your PHP server isn't running or there is something else from preventing your page from being parsed. Does it have a .php extension?

londrum

2:10 pm on Dec 31, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



if you look at what code is included in the preview, it seems to begin straight after the
if($fgmembersite->
bit

for some reason everything before that is not being processed -- including the opening
<?php
tag

do you have comments in the code? maybe it's seeing the -> as the end of a comment, and doesn't recognise what comes after as php because the
<?php
tag has become part of the comment

Hitman3266

4:44 pm on Dec 31, 2011 (gmt 0)

10+ Year Member



maybe you dont have short open tags enabled?

amarh21

9:43 pm on Dec 31, 2011 (gmt 0)

10+ Year Member



I'll check my setup of PHP on my server and try again. I'll get back to you when i'm done.

It's good to know that it probably isn't a coding issue.

Amar