I don't think this is supposed to happen...

PHP 5.3, MySQL 5, Apache 2.2, Windows 7
Easiest is to look at my website, abstuffies.com. I am trying to set up a user authorization thing using a free script–but I am coming across the same issue despite having tried numerous different scripts: the code begins with <?php naturally, but the very next angle bracket in the script, be in an html code or a greater than/less than symbol, immediately thereafter the code displays on the web page. The very next angle bracket it comes to in the script, it stops displaying the code–and the very next angle bracket it starts to display the script on the web page again! wtf is going on? i have spent 20 hours trying to either find a script that works or trying to figure out wtf in the php.ini or httpd.conf could be causing this. All 3 have been added to the path.
I am hosting this on my own computer using dyndys.
I’ll post the issue of being unable to connect to the db later (call to an undefined function, mysql_connect…)

Here is part of the actual script–enuff for you to see on the website what is displaying from the script (it starts to display after the less than 0 sign and stops displaying after the left angle bracket that encloses the ul—then starts to display again after the next angle bracket and so on… ):

<?php if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) > 0 ) { echo '
    '; foreach($_SESSION['ERRMSG_ARR'] as $msg) { echo '
  • ',$msg,'
  • '; } echo '
'; unset($_SESSION['ERRMSG_ARR']); } ?>
First Name

What is your script’s file extension? If it is not index.php (and it looks like it is not) you need to add apache handler so that your file recognized as PHP script. For example if your file is index.html, try to add this line to .htaccess:

Addhandler x-httpd-php .html

Thank you for a very quick reply!

The script is pasted inside index.html.

I copied and pasted the snippet you provided into httpd.conf, thusly:

# For type maps (negotiated resources):
#AddHandler type-map var

Addhandler x-httpd-php .html

#
# Filters allow you to process content before it is sent to the client.

Server was restarted, no fix, computer was restared, still same issue

Are you sure PHP is installed on this server? You can check this by creating file named info.php and place
there this line:

[php]

<?php phpinfo() ?>

[/php]

yes it is installed and working… moreover, i have a second computer that it does the same thing on…

phpinfo displays as it should…

the original script is called register-form.php, but apache pulls up index.html first and i should be able to paste php inside html, i believe

hmmm… now that page won’t open… it used to display properly

You can have apache display what you want as a home page, create .htaccess in the web root and
put this line there:

DirectoryIndex index.php index.html index.htm

Firstly, after the amount of hair-pulling and the hours spent in frustration, I should be at your feet going thank you thank you thank you…
next…

i didn’t have to create a file called .htaccess, i just pasted the snippet in the httpd.conf file and deleted index.html and renamed register-form.php to index.php—and you may see it is displaying properly.

Now, when you click Register off the home page it gives, fatal error… call to undefined function mysql_connect, etc… again, i have spent days with this, and i cannot get any script to connect to the mysql server even though it is installed and functioning, and has been added to the path and the firewall (the airport extreme router has its own firewall: the webserver has been added but do i need to add the mysql also??? i have tried that, mind you…).

All help here is slatheringly appreciated.

just added some simple html to the page to make sure it displays ok… it does ;D

Sponsor our Newsletter | Privacy Policy | Terms of Service