Thomisback Posted April 2, 2008 Share Posted April 2, 2008 Hey, I'm getting an error I haven't seen before, it is the line below which causes it: <?php elseif (isset($_GET['do']) AND $_GET['do'] == 'deny' AND isset($_GET['id'])) { ?> Does anyone see what's wrong with this? Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/ Share on other sites More sharing options...
paul2463 Posted April 2, 2008 Share Posted April 2, 2008 it is difficult to try and figure out a problem from one line of code, php may have told you the error is in this line but if you have missed of a brace or a semi colon from a few lines before it may not fail the parse until this line, in this line in particular I prefer to place each part into a bracket so I know when I go back to it in the future exactly what it is doing elseif ((isset($_GET['do']) && ($_GET['do'] == 'deny') && (isset($_GET['id'])))) Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507317 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Author Share Posted April 2, 2008 Never mind - looked wrong Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507330 Share on other sites More sharing options...
paul2463 Posted April 2, 2008 Share Posted April 2, 2008 still doesnt help me and thats the same line as the first one Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507331 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Author Share Posted April 2, 2008 echo "Selecteer een auto die je wilt kopen:"; echo "<form method="post" action="'.$_SERVER['REQUEST_URI'].'"><select name="auto"> <option value="6000">Mini Cooper €6.000,-</option> <option value="12000">Opel Astra €12.000,-</option> <option value="18000">Ford Mondeo ST220 €18.000,-</option> <option value="24000">Mercedes 300CE €24.000,-</option> <option value="30000">BMW 325Ci €30.000,-</option> <option value="36000">Dodge Ram SRT-10 €36.000,-</option> <option value="42000">Porsche Cayenne €42.000,-</option> <option value="48000">Bentley Continental GT €48.000,-</option> <option value="54000">Hummer H2 €54.000,-</option> <option value="60000">Rolls-Royce Silver Seraph €60.000,-</option> </select> <input type="submit" value="Kopen"></form>"; } else { echo "Ongeldige uitnodiging!"; } } } elseif (isset($_GET['do']) AND $_GET['do'] == 'deny' AND isset($_GET['id'])) { // line 100 causing an error $iOC = intval($_GET['id']); $rOCrime = mysql_query('SELECT wapenexpert,leader,chauffeur,auto,wapen FROM $oc WHERE gamename='$prefix' AND id = '.intval($_GET['id'])); $iOCrime = mysql_num_rows($rOCrime); if ($iOCrime == 0) { echo 'Deze OC bestaat niet (meer). Het kan ook zijn dat 1 van de Team Members de Oc geweigert heeft.'; } else { Hope this helps! Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507335 Share on other sites More sharing options...
lordfrikk Posted April 2, 2008 Share Posted April 2, 2008 Is that echo "<form ... on one line or spanning multiple lines? edit-- HOW can use double quotes in string unescaped? Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507354 Share on other sites More sharing options...
ansarka Posted April 2, 2008 Share Posted April 2, 2008 Try below code ;) echo "<form method=\"post\" action=\"'.$_SERVER[REQUEST_URI].'\"><select name=\"auto\"> <option value=\"6000\">Mini Cooper €6.000,-</option> <option value=\"12000\">Opel Astra €12.000,-</option> <option value=\"18000\">Ford Mondeo ST220 €18.000,-</option> <option value=\"24000\">Mercedes 300CE €24.000,-</option> <option value=\"30000\">BMW 325Ci €30.000,-</option> <option value=\"36000\">Dodge Ram SRT-10 €36.000,-</option> <option value=\"42000\">Porsche Cayenne €42.000,-</option> <option value=\"48000\">Bentley Continental GT €48.000,-</option> <option value=\"54000\">Hummer H2 €54.000,-</option> <option value=\"60000\">Rolls-Royce Silver Seraph €60.000,-</option> </select> <input type=\"submit\" value=\"Kopen\"></form>"; Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507361 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Author Share Posted April 2, 2008 Thanks everyone! You helped me out again Quote Link to comment https://forums.phpfreaks.com/topic/99164-solved-parse-error-syntax-error-unexpected-t_do/#findComment-507377 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.