Voodoo Jai Posted December 29, 2007 Share Posted December 29, 2007 Hi all thanks for the help with my coding Q's, can you help me improve my code now. I have also been told that there may security issues with extracting data from my db, regarding malicious viruses implanted into it. Is only the VARCHAR side of the data stored only vulnerable to this type of attack. ************************************************ echo "<tr>"; echo "<td>"; echo "Sat"; echo "</td>"; echo "<td>"; echo "<div align=\"right\">"; $row_Takeaway['Sat_hr_1']; //IF data in a specific col then SHOW data for a specific col $f = $row_Takeaway['Sat_hr_1']; if ($f <> NULL) { echo "-"; echo $row_Takeaway['Sat_min_1']; } else { echo "Closed"; } echo "</div>"; echo "</td>"; echo "</tr>"; if ($row_Takeaway['List_Type'] == 4 || $row_Takeaway['List_Type'] == 5) { echo"<tr>"; echo"<td valign=\"top\">"; echo"<div align=\"left\">"; echo"<span class=\"style5\">"; echo"Free phone"; echo"</span>"; echo"</div>"; echo"</td>"; echo"<td valign=\"top\">"; echo"<div align=\"left\">"; echo $row_Takeaway['FreePhone']; echo"</div>"; echo"</td>"; echo"</tr>"; ************************************************** I think this code could be improved so any pointers much appreciated. Jai Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/ Share on other sites More sharing options...
kenrbnsn Posted December 29, 2007 Share Posted December 29, 2007 Please edit your post to put a tag before the start of your code and a tag after. This will make your code much more readable in the forum. Ken Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425319 Share on other sites More sharing options...
revraz Posted December 29, 2007 Share Posted December 29, 2007 There is nothing in that code that indicates you pull any data from a DB. Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425327 Share on other sites More sharing options...
Voodoo Jai Posted December 29, 2007 Author Share Posted December 29, 2007 There is nothing in that code that indicates you pull any data from a DB. this bit take data from a db and displays it echo $row_Takeaway['Sat_min_1']; Jai Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425332 Share on other sites More sharing options...
revraz Posted December 29, 2007 Share Posted December 29, 2007 Well, nothing to improve on that line. Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425333 Share on other sites More sharing options...
redarrow Posted December 29, 2007 Share Posted December 29, 2007 get rid off some echo's lol <?php if ($row_Takeaway['List_Type'] == 4 || $row_Takeaway['List_Type'] == 5) { $x=$row_Takeaway["FreePhone"]; $takeaway=<<<EDOC <tr> <td valign="top"> <div align="left"> <span class="style5"> Free phone </span> </div> </td> <td valign="top"> <div align="left"> $x </div> </td> </tr> EDOC; echo $takeaway; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425339 Share on other sites More sharing options...
Voodoo Jai Posted December 29, 2007 Author Share Posted December 29, 2007 get rid off some echo's lol <?php if ($row_Takeaway['List_Type'] == 4 || $row_Takeaway['List_Type'] == 5) { $x=$row_Takeaway["FreePhone"]; $takeaway=<<<EDOC <tr> <td valign="top"> <div align="left"> <span class="style5"> Free phone </span> </div> </td> <td valign="top"> <div align="left"> $x </div> </td> </tr> EDOC; echo $takeaway; } ?> Thats what I was thinking but was not sure. Mmmmmmmmmmmm all that coding for nothing LOL Thanks for the help again Jai Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425341 Share on other sites More sharing options...
Voodoo Jai Posted December 29, 2007 Author Share Posted December 29, 2007 get rid off some echo's lol <?php if ($row_Takeaway['List_Type'] == 4 || $row_Takeaway['List_Type'] == 5) { $x=$row_Takeaway["FreePhone"]; $takeaway=<<<EDOC <tr> <td valign="top"> <div align="left"> <span class="style5"> Free phone </span> </div> </td> <td valign="top"> <div align="left"> $x </div> </td> </tr> EDOC; echo $takeaway; } ?> How do I find more info, explanation of what this EDOC does. It makes it all lokk more tidier and I have a lot of code that I need to do this conversion to. Jai Quote Link to comment https://forums.phpfreaks.com/topic/83598-solved-improve-my-code/#findComment-425348 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.