jb489 Posted July 31, 2009 Share Posted July 31, 2009 Hi all, I am having a slightly peculiar problem which I cant seem to find anything about on the net. I have a project I am doing which consists of a bunch of php files. The 'view' files. i.e: the one handling all html etc is giving me problems when I open it in either safari or mozilla. The problem: I am using less than characters in my php code in code snippets like: for($i=0; $i<count(anarray); $i++) and in the start of a php segment like: <?php ?> Now the browsers are taking the less than characters as some sort of echo function, because instead of performing the code, the code is being printed out to the browser instead, but only from one < to another. I have attached a pic of what exactly is going on. Has anyone every encountered this? I will be most grateful as I am completely lost on what to do Thanks. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted July 31, 2009 Share Posted July 31, 2009 its most likely a syntax error. post your code ? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 31, 2009 Share Posted July 31, 2009 You're problem is not urgent. It is no more urgent than any other topic here. If you want to have priority over other people, i suggest you pay for it. Quote Link to comment Share on other sites More sharing options...
fooDigi Posted July 31, 2009 Share Posted July 31, 2009 it sounds like it is not parsing the document as php, and it thinks the < and > are html tags... just a thought... in the screen shot the file extension is .html.... do you have your web server set up to parse html pages as php? Quote Link to comment Share on other sites More sharing options...
jb489 Posted July 31, 2009 Author Share Posted July 31, 2009 Sorry, please excuse the urgent then... I believe I have a web server which handles php I went through the whole installation and changing of the php.ini file for debugging with zend installed and all. and when i print out the php self, the php page does come up, so i belive thats right. As for the code, shall i send all file? the main segment is this: <div id="leftcolumn"> <div class="innertube"><b>Column Selection</b><br/><br/> <input type="checkbox" name="chkbx_RiskStatus" checked="checked""/>Risk Status<br/> <input type="checkbox" name="chkbx_UserName" checked="checked"/>User Name<br/> <input type="checkbox" name="chkbx_MGAlias" checked="checked"/>MG Alias<br/> <input type="checkbox" name="chkbx_FName" checked="checked"/>First Name<br/> <input type="checkbox" name="chkbx_LName" checked="checked"/>Last Name<br/> <input type="checkbox" name="chkbx_DoB" checked="checked"/>Date of Birth<br/> <input type="checkbox" name="chkbx_Email" checked="checked"/>Email Address<br/> <input type="checkbox" name="chkbx_HPhone" checked="checked"/>Home Phone<br/> <input type="checkbox" name="chkbx_MPhone" checked="checked"/>Mobile Phone<br/> <input type="checkbox" name="chkbx_City" checked="checked"/>City<br/> <input type="checkbox" name="chkbx_PostCode" checked="checked"/>Post Code<br/> <input type="checkbox" name="chkbx_CardNumber" checked="checked"/>Card Number<br/> <input type="checkbox" name="chkbx_Password" checked="checked"/>Password<br/> <input type="checkbox" name="chkbx_FlashID" checked="checked"/>Flash ID<br/> <input type="checkbox" name="chkbx_CookieID" checked="checked"/>Cookie ID<br/> <input type="checkbox" name="chkbx_SAnswer" checked="checked"/>Secret Answer<br/> <input type="checkbox" name="chkbx_IP" checked="checked"/>IP<br/> <input type="checkbox" name="chkbx_Signup" checked="checked"/>Sign-up time<br/> <input type="checkbox" name="chkbx_SuccessfulDeposits" checked="checked"/>Sucessful Deposits<br/> <input type="checkbox" name="chkbx_LavinAccountStatus" checked="checked"/>Lavin Account Status<br/><br/> <input type="button" name="btn_setColumns" value="Set Columns" onclick="><?php refreshColumns()?>"></input> </div> </div> <div id="rightcolumn"> <div class="innertube"><b>Search for: </b> <br/><br/> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <textarea name="username" cols="20" rows="1">Enter user name here...</textarea><br/><br/> <input type="submit" value="Go SAM !!"/> </form> </div> </div> </div> <div id="footer"> <h5> <div> <input type="image" src="images/buttonPrev.gif" value="<< Previous" alt="[Previous]" name="imgbtnPrevious" title="Move to previous page of results"/> <input type="image" src="images/buttonNext.gif" value="Next >>" alt="[Next]" name="imgbtnNext" title="Move to next page of results" /> </div> </h5> </div> <?php function initialize(){ try{ if(!$_POST){ $custconfig = new Configuration(); $_SESSION["custconfig"] = $custconfig; goSAM("james"); } else { $custconfig = $_SESSION['custconfig']; if(isset($_POST["username"])) { if($_POST["username"] != "Enter user name here...") { goSAM($_POST["username"]); } } } } catch(Exception $e) { } } //Method which performs the SAM functionality function goSAM($TypedUsername) { getTypedUser($TypedUsername); getMatchesandSort(); } //Method to find the details of user typed in to the text box function getTypedUser($TypedUsername) { $custconfig = $_SESSION["custconfig"]; $DatabaseConnector = new DatabaseConnector(); $TemplateQuery = $custconfig->getSqlStatement("SingleUser"); $Query = str_replace("@username", $TypedUsername, $TemplateQuery); $testData = $DatabaseConnector->getDataSet($custconfig->ConnectionString(), $Query); $_SESSION["singleUserDatagrid"] = $testData; } AND HERE: <body> <div id="maincontainer"> <div id="topsection" class="headertube"> <img src="/images/header.gif" width="100%" height="100%" /> </div> <div id="contentwrapper"> <div id="contentcolumn"> <div class="innertube"> <b> <?php if(isset($_SESSION["singleUserDatagrid"])) { print("Sam found:"); } ?> </b> <div> <?php if(isset($_SESSION["singleUserDatagrid"])) { print("<table width='500' class='sortable' border='5' cellpadding='5'>"); print("<tbody>"); print("<tr align=center>"); $singleUserGrid = $_SESSION["singleUserDatagrid"]; print("<td width=20>".$singleUserGrid[0]["riskstatus"]."</td>"); print("<td width=20>".$singleUserGrid[0]["username"]."</td>"); print("<td width=20>".$singleUserGrid[0]["mgalias"]."</td>"); print("<td width=20>".$singleUserGrid[0]["firstname"]."</td>"); print("<td width=20>".$singleUserGrid[0]["lastname"]."</td>"); print("<td width=20>".$singleUserGrid[0]["dob"]."</td>"); print("<td width=20>".$singleUserGrid[0]["email"]."</td>"); print("<td width=20>".$singleUserGrid[0]["homephone"]."</td>"); print("<td width=20>".$singleUserGrid[0]["mobilephone"]."</td>"); print("<td width=20>".$singleUserGrid[0]["city"]."</td>"); print("<td width=20>".$singleUserGrid[0]["postcode"]."</td>"); print("<td width=20>".$singleUserGrid[0]["cardnumber"]."</td>"); print("<td width=20>".$singleUserGrid[0]["password"]."</td>"); print("<td width=20>".$singleUserGrid[0]["flashid"]."</td>"); print("<td width=20>".$singleUserGrid[0]["cookieid"]."</td>"); print("<td width=20>".$singleUserGrid[0]["secretanswer"]."</td>"); print("<td width=20>".$singleUserGrid[0]["ip"]."</td>"); print("<td width=20>".$singleUserGrid[0]["signuptime"]."</td>"); print("<td width=20>".$singleUserGrid[0]["successfuldeposits"]."</td>"); print("<td width=20>".$singleUserGrid[0]["lavinaccountstatus"]."</td>"); print("</tr>"); print("</tbody>"); print("</table>"); } ?> </div> Quote Link to comment Share on other sites More sharing options...
fooDigi Posted July 31, 2009 Share Posted July 31, 2009 did you save that second file with the file extension .php... in your screenshot it it Main.html Quote Link to comment Share on other sites More sharing options...
jb489 Posted July 31, 2009 Author Share Posted July 31, 2009 i changed everything back to php for now. I am pretty new to php and not exactly sure of everything. you can have a web page in .php right ? Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted July 31, 2009 Share Posted July 31, 2009 Haha... I am going to put URGENT in the title of every post I ever make just to see if I can get gr's head to explode And unless you have you php install set to parse .html files as php files, it needs to have the extension .php Quote Link to comment 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.