Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

PHP-script errors..


(!)

DeniseSamuela's Avatar
DeniseSamuela DeniseSamuela is offline
Member with 5 posts.
THREAD STARTER
 
Join Date: Jun 2012
10-Jun-2012, 10:55 AM #1
PHP-script errors..
Hi,

I've tried to test my php-gamescript in UsbWebserver 7.0.
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
function letters_only($string)  

$eregi eregi_replace("([A-Z]+)","",$string); 
if(empty(
$eregi)) { 
return 
true

return 
false

if(!
$POST["submit"])  
    {  
    
$woorden = array("geweldig""condensatiepolymerisatie""additiepolymerisatie");   
    
$randomrand(0,count($woorden)-1);  
    
$woord=$woorden[$random];  
    
$sessie["woord"]=$woord;  
    
$teller=7;   
    for (
$x=0;$x<strlen($woord);$x++){  
    
$verborgen.="-";}  
    }   
else  
    {  
    
$letter=$POST["letter"];  
    
$woord=$_sessie["woord"];  
    
$hiddenword=$POST["hidden"];  
    
$gebruikt=$POST["gebruikt"];  
    
$teller=$POST["teller"];  
    
$gebruikt.=$letter;  
    
$verborgen="";  
    
$juist=false;  
    }   


if(
substr($woord,$x,1)==$letter

$verborgen.=$letter
$juist=true


else 

$verborgen.=substr($verborgenwoord,$x,1); 

  

if(!
$juist
{  
$teller--; 


if (
$woord==$verborgen

echo 
"Gefeliciteerd u heeft het woord geraden<br>"
echo 
"Het woord was: ".$woord
$end=true
if (
$teller==0
echo 
"U heeft 7 keer geraden, u bent af";  
echo 
"<br> Het woord was: ".$woord


if(
$end=true); 


if (!
$end

echo 
"Voorlopig heeft u dit geraden:<br>"
echo 
$verborgen
echo 
"<br>U heeft nog ".$teller." levens<br>"
if(
$gebruikt
echo 
"Deze letters heeft u al gebruikt:" .strtoupper($gebruikt); 
}  
?>
</body>
</html>
The test run says the following:
Notice: Undefined variable: POST in F:\UsbWebserver\Root\game.php on line 17

Notice: Undefined variable: verborgen in F:\UsbWebserver\Root\game.php on line 25

Notice: Undefined variable: letter in F:\UsbWebserver\Root\game.php on line 40

Notice: Undefined variable: letter in F:\UsbWebserver\Root\game.php on line 42

I really don't understand why the test run says this, because, for example, my $POST is defined in (!$POST["submit"]) , right?

Can anyone help me with improving my script? I really want my script to be 100% working

Kind regards,

Denise
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline allnodcoms has a Profile Picture
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
11-Jun-2012, 03:57 AM #2
That should be $_POST["submit"] (note underscore)...

That will probably fix your script

Danny
dukevyner's Avatar
dukevyner   (Luke) dukevyner is offline
Computer Specs
Member with 787 posts.
 
Join Date: Nov 2011
Location: Pakenham, VIC, Australia
Experience: Advanced
11-Jun-2012, 09:28 PM #3
Quote:
Originally Posted by allnodcoms View Post
That should be $_POST["submit"] (note underscore)...

That will probably fix your script

Danny
Yup, he's right, if this solves the problem be sure to click the "mark solved" button at the top of the page
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑