KMC1499 Posted October 13, 2008 Share Posted October 13, 2008 Im in need of some help, im trying to learn more about php and iis. I have a simple site on a win 2k3 server. everything was going fine until dreamweaver asked about being the site manager and boom most of my php stuff isnt working anymore. I checked the see if what verbs i was allowing and its set to allow all on the site main and site levels. My php config page still comes up so php is working. This page worked before dreamweaver did its thing but now all i get is a 500 error when i try and access it <?php function square($num) { $num *= $num; return $num; } $someNum = 6; echo(Variable before going into the function = . $someNum); $results = square($someNum); echo(<br>Variable after going into the function = . $someNum . <br>Results of function = .$results); ?> here is what my log file says. #Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status 2008-10-09 18:13:31 W3SVC1 172.16.0.4 GET /numbers.php - 80 - 172.16.0.23 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.648;+.NET+CLR+3.5.21022;+InfoPath.2) 500 0 0 I turned on the display errors and it reads: Parse error: syntax error, unexpected T_STRING in D:\phptest\numbers.php on line 8 It says thing similar to this on other php files i have that were working before. Any help would be greatly apprectiated, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/ Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 Looks like you have some syntax errors not get and post. Change these lines echo("Variable before going into the function = " . $someNum); $results = square($someNum); echo(" Variable after going into the function = " . $someNum . " Results of function = " . $results); Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664052 Share on other sites More sharing options...
KMC1499 Posted October 13, 2008 Author Share Posted October 13, 2008 I understand what your saying but this is happening with alot of code even the stuff im getting straight from the book im trying to learn from. It all worked before. Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664112 Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 everything was going fine until dreamweaver asked about being the site manager and boom most of my php stuff isnt working anymore. What exactly happened? I only use dreamweaver to edit, not sure about their wizards and managers. Seems like it altered a lot of your code. Did you have a backup? Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664115 Share on other sites More sharing options...
KMC1499 Posted October 13, 2008 Author Share Posted October 13, 2008 First off thanks for taking the time to help me figure this out. It started about a week ago. At first i was using notepad to edit the pages but then i switched to dreamweaver. All was fine until the site manager wizard came up and i went through that. I did enable server technology. After that i started getting the 500 errors on some of the pages that had previously been working. Even the scripts i get from my pdf and online sources are getting these errors. As you see in the other example the error was in the echo so i found an echo example to test the code and i found this script: <?php $my_string = "Hello Bob. My name is: "; $my_number = 4; $my_letter = a; echo $my_string; echo $my_number; echo $my_letter; ?> actual print out: Notice: Use of undefined constant a - assumed 'a' in D:\phptest\echo.php on line 4 Hello Bob. My name is: 4a i went back changed $my_number = 4; $my_letter = a; to $my_number = "4"; $my_letter = "a"; and it worked fine Since im new to the php code im not totally sure whats going on but argh! its annoying lol Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664171 Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 I'm not sure. Obviously you can't have $my_letter = a; Looks like Dreamweaver changed your code around or something, but I'm not a DW expert. Maybe someone on here can help fix your problem. Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664184 Share on other sites More sharing options...
KMC1499 Posted October 13, 2008 Author Share Posted October 13, 2008 heres a form i modified to have people reserve resources on our intranet i was going to have it connect to a mysql database in the future <HTML> <HEAD> <TITLE>Processing All Form Elements</TITLE> </HEAD> <BODY BGCOLOR=”#ffffff”> <FORM name=”frm_Example” action=”allformelements.php” method=”post”> <table border=”0” cellpadding=”2” cellspacing=”0”> <tr> <td align=”left” valign=”top”><b>Your Name?</b></td> <td align=”left” valign=”top”><input type=”text” name=”strname”></td> </tr> <tr> <td align=”left” valign=”top”><b>Hours Needed</b></td> <td align=”left” valign=”top”> <select name=”dblhour”> <option value=”1”>1</option> <option value=”2”>2</option> <option value=”3”>3</option> </select> </td> </tr> <tr> <td align=”left” valign=”top”><b>Confrence room needed</b></td> <td align=”left” valign=”top”> <input type=”radio” name=”strLocation” value=”Main”>main <input type=”radio” name=”strLocation” value=”Glass” checked>Glass <input type=”radio” name=”strLocation” value=”Creative”>Creative </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>Projector <input type=”checkbox” name=”nEquipmentID[]” value=”2” checked>Speakers <input type=”checkbox” name=”nEquipmentID[]” value=”3” checked>Microphone </td> </tr> <tr> <td align=”left” valign=”top” colspan=”2”><input type=”submit” value=”Submit”></ td> </tr> </table> </FORM> <?php if($_POST) { $strname = $_POST[‘strname’]; $dblhour = $_POST[‘dblhour’]; $strLocation = $_POST[‘strLocation’]; echo=(You Chose <br> $strname <br> $dblhour <br> $strLocation <br>); $listvals = $_POST[‘nEquipmentID’]; for($i=0;$i<count($_POST[‘nEquipmentID’]);$i++) echo “Equipment ID $i=”.$listvals[$i].”<br>\n”; } ?> </BODY> </HTML> This did work but all i get now is: Parse error: syntax error, unexpected '=' in D:\phptest\equipment.php on line 56 Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664211 Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 echo “Equipment ID $i=”.$listvals[$i].” \n”; It thinks the '=' sign is part of the variable. Put a space or if you want it concatenated you need to use '.' Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664219 Share on other sites More sharing options...
KMC1499 Posted October 13, 2008 Author Share Posted October 13, 2008 Sorry this is line 56 i changed it to echo "You Chose"; echo $strname; echo $dblhour; echo $strLocation; which got rid of my error looks like somehow the code needs to be changed for some reason and this is where the learning curve kicks in! Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\phptest\equipment.php on line 62 line 62 echo Equipment ID $i=.$listvals[$i].<br>\n; well looks like i have some learning to do! Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-664282 Share on other sites More sharing options...
GoldDog Posted October 27, 2008 Share Posted October 27, 2008 The "=" sign mentioned is a result of DW's re-rendering of the code. I am experiencing the same behavior and I am writing in ColdFusion. DW is destroying all my code. It is rather frustrating to say the least. If anyone can offer instructions to prevent DW from rewriting code I think that's what we're all after here. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-675798 Share on other sites More sharing options...
GoldDog Posted October 27, 2008 Share Posted October 27, 2008 The answer was in my question... Open Preferences and click "Code Rewriting". Un-check the Special Characters prefs. Remarkable, really-- Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-675824 Share on other sites More sharing options...
KMC1499 Posted October 27, 2008 Author Share Posted October 27, 2008 Thanks GoldDog Quote Link to comment https://forums.phpfreaks.com/topic/128215-get-and-post-not-working-after-dreamweaver-changes/#findComment-676049 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.