PHP (noob)

Soldato
Joined
8 Oct 2005
Posts
4,184
Location
Midlands, UK
Hi,

If i get:

Method Not Allowed

The requested method POST is not allowed for the URL /site/join.html.

when i try to run a simple php script does it mean POST has been disabled by my host (tsohost)?

Just made a very very basic script for my site that posts the info from a form onto a page, using the following:

PHP:
<? php 

define("BR", "<br />");

$name = $_POST["txtname"];
$password = $_POST["txtpassword"];
$email = $_POST["txtemail"];
$location = $_POST["optlocation"];
$age = $_POST["txtage"];
$gametypes = $_POST["optgametypes"];
$currentclan = $_POST["txtcurrentclan"];
$previousclans = $_POST["txtpreviousclans"];
$additionalinfo = $_POST["txtadditionalinfo"];

echo "Name: $name" . BR . "Password: $password" . BR . "Mail: $email" . BR . "Location: $location" . BR . "Age: $age" . BR . "Gametypes: $gametypes" . BR . "Current Clan: $currentclan" . BR . "Previous Clan: $previousclans" . BR . "Other Info: $additionalinfo";

?>

Thanks
 
Last edited:
bah, just renamed the html file to .php. I assume to script runs now as i get the following error now:

Code:
[b]Parse error[/b]:  syntax error, unexpected T_STRING in [b]/home/rallport/public_html/site/submit.php[/b] on line [b]3[/b]
 
bah, just renamed the html file to .php. I assume to script runs now as i get the following error now:

PHP:
Parse error:  syntax error, unexpected T_STRING in /home/rallport/public_html/site/submit.php on line 3

Any ideas?
 
Right, thats works now and outputs the data on an unformatted page. On the original page where the form is located, everything is formatted nicely, links to css files etc. My question: how can i include the php code on this page so rtaht formatting is included - e.g. outputs on the same page. I'm kinda stuick as the form action is "submit.php".

Thanks for any help.

EDIT: just figured that out, apologies for the noob question.
 
Last edited:
Again, apologies for my noob questions, as everyone on here seems to be very knowledgeable on programming. I have declared a variable called today

PHP:
$today = date("F j, Y, g:i a");

Now, how can i show the date in 48 hours from $today ?
 
Back
Top Bottom