Jump to content

luckydog

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

luckydog's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. DOH! I knew that. And 10-4 on the tags.
  2. How are you invoking the script? Does the name of the script end with "php" or "html"? It should end with "php". From Notepad++ RUN->Launch in IE (or Firefox) or from IE File->Open... "are you sure your a) using a php file, and b) your server supports php?" The file extension is .php. Apache has run other php scripts without a problem. However, when I run this (from the CD that came with my book): <HTML> <HEAD> <TITLE>Processing All Form Elements</TITLE> </HEAD> <BODY BGCOLOR="#ffffff"> <FORM name="frm_Example" action="example04_02.php" method="post"> <table border="0" cellpadding="2" cellspacing="0"> <tr> <td align="left" valign="top"><b>Characters Name</b></td> <td align="left" valign="top"><input type="text" name="strCharacter"></td> </tr> <tr> <td align="left" valign="top"><b>Starting Amount of Gold</b></td> <td align="left" valign="top"> <select name="dblGold"> <option value="1000">1000</option> <option value="2000">2000</option> <option value="3000">3000</option> </select> </td> </tr> <tr> <td align="left" valign="top"><b>Starting Location</b></td> <td align="left" valign="top"> <input type="radio" name="strLocation" value="mountains">Mountains <input type="radio" name="strLocation" value="plains" checked>Plains <input type="radio" name="strLocation" value="swamp">Swamp </td> </tr> <tr> <td align="left" valign="top"><b>Equipment</b></td> <td align="left" valign="top"> <input type="checkbox" name="nEquipmentID[]" value="1" checked>Sword <input type="checkbox" name="nEquipmentID[]" value="2" checked>Chain Mail <input type="checkbox" name="nEquipmentID[]" value="2345" checked>Shield <input type="checkbox" name="nEquipmentID[]" value="4">Cross Bow <input type="checkbox" name="nEquipmentID[]" value="5">Arrows </td> </tr> <tr> <td align="left" valign="top" colspan="2"><input type="submit" value="Submit"></td> </tr> </table> </FORM> <?php if($_POST) { $strCharacter = $_POST['strCharacter']; $dblGold = $_POST['dblGold']; $strLocation = $_POST['strLocation']; echo("You Chose:<BR>$strCharacter<BR>$dblGold<BR>$strLocation<BR>"); $listvals = $_POST['nEquipmentID']; for($i=0;$i<count($_POST['nEquipmentID']);$i++) echo "Equipment ID $i=".$listvals[$i]."<br>\n"; } ?> </BODY> </HTML> Internet Explorer shows the form as expected but then prints: $strCharacter $dblGold $strLocation "); $listvals = $_POST['nEquipmentID']; for($i=0;$i\n"; } ?> at the end. Thanks for all the help.
  3. Thanks Glyde- In IE I still got a blank page. In Firefox it printed, ", print_r($array, true), ""; ?>
  4. Just started with PHP but I am familiar with C++/C#. When I run: <HTML> <HEAD> <TITLE>FIRST PHP RUN</TITLE> </HEAD> <BODY bgcolor="0000ff"> <?php echo("This was written out by PHP"); ?> </BODY> </HTML> through IE or Firefox I get the right background color but no echo, no "This was written out by PHP". Tried "print" also but none of that happening either. If I run: <?php phpinfo(); ?> I get the PHP information page as expected. I'm working through the book PHP Game Programming by Matt Rutledge. When I run one of the pages of code that came with it they work fine. It's going to be hard to move on until I can get this resolved. Any ideas? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.