-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
what the error is ? $db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die(mysql_error()); $db_select = mysql_select_db($databasename, $db) or die(mysql_error());
-
One account from one pc, the idea above will stop mutliple logons and multiple browsers add taith's and it should work (maybe a problem with FF tabs) but you can get around them using a expected next key.. will explain more if needed
-
But is it compatible with Vista?
-
can you post the results (or some of them)
-
at the top of the function causing the problem.. check the line numbers
-
try print_r($personalinfo); at the end
-
How to have best possible protection for your website?
MadTechie replied to sayedsohail's topic in PHP Coding Help
take the server your site is stored on and disconnect all cables and burn it.. thats about the only 100% way.. but can cause access problems.. so Filter ALL user input. (check for SQL Injection, XSS cross site scripting) the most common hole are once the user is logged in and theirs a little area with you missed on filtering ie shout box, searching, etc without knowing more detail its kinda hard to say.. -
thats correct (what my idea will do) unless your suggecting something else!
-
almost to use Laziness Instead of Greediness, try this %<div style="display:none;">(.*?)</div>%si
-
@conker87 could be a little bit on a secuirty risk in some cases.. giving the user that much control..!
-
OK let me just logon to your site and get a cookie set.. Great.. now let me edit the username to include some SQL injection thats the first problem i see ie set the cookie to a' or 1=1-- so SQL = SELECT * FROM `members_table` WHERE `username_field` = 'a' or 1=1--' of course i could just drop your tables or update the password infact anything i please. in other words filter ALL user input this includes cookies as they can be edited by the user as for storing the password, i hope you also used salt.. personally i could have a "tagcode" or the UserID so if cookie_userid & cookie_username match and leave the password out.. (maybe md5 the username)
-
try change $fp = fopen($path, 'rb'); while(!feof($fp)) { if(connection_aborted()) die(); echo fread($fp, 1024); flush(); } fclose($fp); to readfile($path); when the file downloads.. open it in wordpad and check the top to see if theirs any php output (ie errors)
-
personally, i use what ever fits best in my project.. normally a login.php file but my common.php (commonly used functions) get a routine for checking login status etc
-
it does work http://www.bf2stats.nl/progress.php?score=20 20 = the percentage
-
try adding header("Content-Transfer-Encoding: binary");
-
change } else { to } if ( !isset($_GET['page']) ) {
-
ok theirs the problem add <?php session_start(); ?> to the top of header.php (i assume thats going to be used everywhere) so <?php session_start(); ?> <html> <head> <title>Dotti CMS - Dotti</title> </head> <body> you can probably change this is user/main.php <?php /* Include Files *********************/ //session_start(); //<---commented out include("database.php"); include("login.php"); /*************************************/ displayLogin(); ?> basically you can't output to the page before using session_start
-
post the first 20 lines of header.php please use code tags (#) also read the pinned thread headers
-
Wrong section should be in HTML
-
try this <?php // Page information will go here if ($_GET['page'] == 'news') { if (isset($_GET['id']) ) { $query="SELECT * FROM news WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><div align=\"left\"><strong><span class=\"style1\"><p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." -</strong> ".$row['extcontent']." <br /> </p> <hr /></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); }else { $query="SELECT * FROM news"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><a href='index2.php?page=news&id=".$row['id']."'><strong><span class=\"style1\">".$row['date']." - ".$row['heading']."</span></strong></a></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); } } if ($_GET['page'] == 'company') { $query="SELECT * FROM company"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><span class=\"style1\">".$row['overview']."<br /> </span></div><br></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> "); } else { echo("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#003366\">"); echo("<tr>"); echo("<td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">"); echo("<tr>"); echo("<td><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"); echo("<tr>"); echo("<td width=\"67%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the greeting mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM homegreet"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><strong>".$row['heading']."<br /> </strong><span class=\"style1\">".$row['content']."<br /> </span></div>"); echo("</td>"); echo("</tr>"); echo("</table></td>"); echo("</tr>"); echo("</table>"); echo("<br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\">"); echo("<strong><span class=\"style1\">Our Featured Client<br />"); echo("</span></strong>"); // This is the date information for the Featured Client mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM featureclient"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><a href=".$row['url']." target=\"_blank\">".$row['client']."</a><br /> ".$row['desc']."</span></div>"); echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<br /></td>"); echo ("<td width=\"33%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo ("<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo ("<tr>"); echo ("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo ("<tr>"); echo ("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the company news mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM news LIMIT 0,5"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo ("<p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." - ".$row['content']." <br /> <a href='index.php?page=news&id=".$row['id']."'>Read on</a>.<br /> </p> <hr /> </div>"); } echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<div align=\"center\" class=\"style1\"><span class=\"style8\"><br />"); echo ("</span></div>"); echo ("<div align=\"center\" class=\"style1\">"); } echo ("<div align=\"center\" class=\"style1\">"); // FOOTER mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM footer"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("".$row['content']."<br><a href=".$row['agreeurl'].">".$row['agreetxt']."</a> - <a href=".$row['privacyurl'].">".$row['privacytxt']."</a><br><br>Tantrum Internet, ".$row['address']."<br>Phone ".$row['phone']." - Fax ".$row['fax'].""); echo ("</div>"); echo ("</body>"); echo ("</html>"); ?>
-
if (preg_match('%<div style="display:none;">(.*)</div>%si', $page, $description)) { $description= $description[0]; } else { $description= ""; } echo $description;
-
[SOLVED] Code working in firefox but not IE 7
MadTechie replied to rhyspaterson's topic in PHP Coding Help
check the input.. -
[SOLVED] Code working in firefox but not IE 7
MadTechie replied to rhyspaterson's topic in PHP Coding Help
its output that the browser used the code is parsed by the server... most common problem is javascript in FF to IE7 -
As where here now heres a very basic class but you can see the use of ie (it was just an example) old post but try it without using a class (it becomes messy)