Web Hosting Talk







View Full Version : PHP help


acidhoss
11-01-2002, 07:19 PM
Well hello all,
I got a PHP question: I've set up PHP on windows ME and everytime i try getting a script to take form input, i get errors on all of the form elements. Example (this is a script a friend of mine wrote) :
<?
//BVSD Tag Board
//
//
//http://bvsd.********


require ("config.php");


//Strip Slashes
$username = stripslashes($username);
$message = stripslashes($message);


//Check to see if all fields were filled in.
if ( empty($username)) {
$postname = $anonyname;
}
else {
$postname = $username;
}

if ( empty($URL)) {
$nameformat = "<font color=\"#336699\"><B>$postname</b></font>»";
}
elseif ($URL == "http://") {
$nameformat = "<font color=\"#336699\"><B><a href=\"$sitelink\" target=\"_blank\">$postname</a></b></font>»";
}
else {
$nameformat = "<font color=\"#336699\"><b><a href=\"$URL\" target=\"_blank\">$postname</a></b></font>»";
}
if ( empty($message)) {
$msg = $anonymsg;
}
else {
$msg = $message;
}


//Post to datebase

$logit = "$nameformat $msg<br>\n";

$fp = fopen ("tagboard.txt", "a+");
fwrite ($fp, $logit);
fclose ($fp);

header("location: tags.php")
?>




Any idears? Also, Im running on apache 1.3.1and it won't parse the php includes files.

jtrovato
11-01-2002, 07:32 PM
action application/x-httpd-php "c:\php\php.exe"

and

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

You don't need the .htm or the .html it will still work without those extention as long as the file as a .php extention

this has to go in your

httpd.conf file

the path to this file is

C:\program files\Apache Group\Apache\conf


as long as you didn't install it in a different directory. Also try not using Apache/ PHP /MySQL on Windows ME. It's not very stable.

If you can try it on at least windows 2000 Professional. I found it to work better. I know it's probabaly a testing machine so that's fine.

John

acidhoss
11-01-2002, 07:33 PM
Thank you very much John.

jtrovato
11-01-2002, 07:38 PM
no problem

action application/x-httpd-php "c:\php\php.exe"
AddType application/x-httpd-php .php

as long as you have these two lines in that config file it should work. Good luck if you have any questions grassy ass let me know.

John

acidhoss
11-01-2002, 07:42 PM
You do know grassy ass = gracias, right? lol, ok, I'll try it out and let you know how it worked. "Grassy ass" once more.

jtrovato
11-01-2002, 07:43 PM
yes I know, I was being funny too. I call my girlfriend grassy ass. no pun intended...

acidhoss
11-01-2002, 07:45 PM
Lol, you cal your gf grassy ass? Hmm, i bet that makes her day...lol

jtrovato
11-01-2002, 07:59 PM
She's a great person and very secure in herself. Otherwise I would be single lol

chat with you soon...

john

acidhoss
11-02-2002, 11:34 PM
lol, well good for you. ttyl