Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. can you post your latest code
  2. If you was going to use RegEx, this would be simpler! <?php //Get the URI (from the address bar) #$str = $_SERVER['REQUEST_URI']; $str = 'http://www.sitename.com/articles/2007/10/article-title-name/2'; preg_match_all('%/([^/]*)%i', $str, $result, PREG_PATTERN_ORDER); $bits = $result[1]; echo $bits[5]; ?>
  3. are you sending from the same domain the php server is on ? or do you have a Sender Policy Framework (SPF)? if so add an SPF record in your DNS zone file to allow the sending from the php severs IP.
  4. a simple check will be okay, <?php //make sures its .php not .php.inc if(!IN_MySystemName) { die("Access Denied"); } //Config settings (not echoing) $password="Blar"; etc ?> <?php define("IN_MySystemName", true); include "config.php" ?> you could encrypted it as well (if you feel the need, but that becomes a pain If they get FTP access then your stuffed.. the most common problems are things like SQL Injection..
  5. Either Update the PHP.INI file, or if you don't have direct access to the server ini_set what part do you not understand ?
  6. ~Sighs~.. Using AJAX.. See here
  7. Few fixes <?php if($row) { $time = date("D d F Y H:i:s"); $ip = $_SERVER['REMOTE_ADDR']; mysql_query("INSERT INTO `user_logs` (`userid`,`ip`,`time`) VALUES ('{$row['id']}','$ip','$time')"); mysql_query("DELETE FROM `guests` WHERE `ip` = '$ip' "); if(!isset($_POST['staylogged'])) { $_SESSION["user"] = $row['username']; } else { setcookie("user", $row['username'], time()+(3600*24*1)); //1 day (change 1 to suite) } ?> <?php if($_SESSION['user']) { $query = mysql_query("SELECT * FROM `users` WHERE `username` = '{$_SESSION['user']}'"); $user = mysql_fetch_array($query); $logged = true; } if($_COOKIE['user']) { $query = mysql_query("SELECT * FROM `users` WHERE `username` = '{$_COOKIE['user']}'"); $user = mysql_fetch_array($query); $logged = true; } ?>
  8. i think he means <?php //Get the URI (from the address bar) $str = $_SERVER['REQUEST_URI']; //+GingerRobot code $bits = explode('/',$str); echo $bits[4];//the article name //(changed to 4 as REQUEST_URI skips the http://) ?>
  9. maybe try using stream_get_contents and cycle throught the page in X bytes, also use flush to output the curently steamed bytes
  10. try ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('', 'INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') NOT NULL;
  11. I hear of many IIS problems.. also Around and around we go..
  12. try this <?php echo "please click to choose brand:"; echo "<select name=\"combo\" onchange=\"submit();\">"; for($i=0; $i < $rows; $i++) { $id =mysql_result($result,$i,"id"); $name =mysql_result($result,$i,"name"); $sel = ($_REQUEST['combo'] == $i)?"selected=\"selected\"":""; //ADDED echo "<option value=\"$id\" $sel>$name</option>"; //UPDATED }; echo "</select>"; ?>
  13. your need to use AJAX Read up on Ajax, Ajax freaks tut,
  14. your need to change the account your sending from.. thats the behalf of..account ini_set
  15. Looking at the memory size.. it would seam to be a PECL problem, or a problem in the script.. do you have the lastes version of php_printer.dll? also are you trying the same test on the new server compared to the old one ? any other printing issules on the new server ?
  16. as an idea.. why not <form method="post"> <?php $showshoutsql = mysql_query("SELECT * FROM shouts ORDER BY $sortshout $ordershout"); $showshoutcount = mysql_num_rows($showshoutsql); if (isset($_POST['removeselected'])) { for ($i = 0; $i < $showshoutcount; $i++) { $chex = $_POST['chex$i']; echo "$chex <br />"; } } $n=0; while ($row = mysql_fetch_array($showshoutsql)) { echo "<input type=\"checkbox\" value=\"$id\" name=\"chex$n\"> \n"; $n++; } ?> <br /> <input name="removeselected" type="submit" value="Remove Selected"> </form> EDIT: WooHoo re-writing the JS is much better,
  17. check the memory.. on the new server check the memory setting in the php.ini file ie
  18. IMO i think this is javascript problem.. (if you can use an array in your javascript) not a PHP one, sure we can suggest "workarounds" but why not just fix the fault !
  19. really depends on the SMTP provider,
  20. the file isn't uploading.. check your timeouts,
  21. Either write a parse. or maybe use COM's to extract the text
  22. Its just a way of working out the pro's and con's.. yeah microseconds.. running once isn't a problem... but you may not run it once.. you may need to use it on a database with millions records.. and that may only be part of a routine thats run hourly.. in that case.. your at the point of security vs usability or even durability.. without knowing exactly what its going to be used for we can only look at the pro's and cons
  23. i know what your trying to do.. but you have add them into a form.. with a submit button.. that submit button will have no effect.. $_POST["username"]=$username; will work with an include but NOT on a post (that the submit button will perform).. Ok see example <?php } else { $error = array(); //ErrorArray if ($first_name == "") { $error[] = "You must enter a firstname"; } if ($surname == "") { $error[] = "You must enter a surname"; } if ($email_address == "") { $error[] = "You must enter an email address"; } //SNIPP.... ?> You have the following errors: <br /> <?php //Display errors foreach($error as $e) { echo "$e<br>"; } ?>
  24. true also, an old saying "it doesn't matter how strong the front door is, if the windows left open" you are the weakest link.. good bye
  25. Ouch.. i don't believe i missed that..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.