Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Coolie Can you click solved
  2. a simple trick is to have a page called download.php that does the headers and output for the force download.. Then on you page you wish to have the download link and redirect from have the link like so <a href="forcedownload.php?link=myfile.pdf" target="_blank" onclick="javascript:window.location = "mainpage.php">Download</a>; Now that "should" give you a download prompt and then redirect you to mainpage.php Now i know it say target="_blank" which should open a new window but with the file type set correctly the window will not open as you have told it your downloading an attachment.. hope that works helps
  3. <?php else { //else to what ?> <form action="palindromes.php" method="GET"> EDIT: maybe this will help! <?php if (isset($_GET["string"])) { $s = $_GET["string"]; if (strlen($s) > 20) { ?> <p>Oh my! Your string is too big. <?php }elseif (strrev($s) == $s){ echo "$s"; }else { unset ($s); } }//EDIT#2: either move this down ?> <br /> <a href='palindromes.php'>Try Again</a> <?php else {//else to what ? EDIT#2: OR move this up but they should be together! ?> <form action="palindromes.php" method="GET"> Your String: <input type="text" name="string" /> <input type="Submit" value="Submit"/> <?php } ?>
  4. because thats being called from the web page not php! if you have $webRoot = "http://blar.com/tester/" then change that depending the pc your developing on it should be fine!
  5. Yep you need to mysql_query before you mysql_fetch ie <?php $query = "SELECT * FROM `blogs` ORDER BY `lastchecked` DESC LIMIT 1"; $result = mysql_query($query); $row = mysql_fetch_array($result ) or die (mysql_error()); $url = $row[url]; ?>
  6. From a default install it should work however their could be something else that blocking it ie firewall can you post your phpinfo() data or your PHP.ini file.. personally i don't think it will help much as this isn't really my topic!
  7. Erm.. Yes it does! PHP does garbage collection at 3 points 1. When you use unset() or other cleanup options! 2. When you leave a function (php clears any variable that leaves scope) 3. When the script ends (php clears any variable that leaves scope)
  8. Did you try that script mod ?
  9. As i said before I'm pretty sure its something blocking the connection all connections seam to be affected.. Can you try your code one another computer?
  10. Okay.. i give.. can you show me the code that does the upload from phpmailer.. infact show me any phpcode that does an upload!
  11. try this // create intermediate links for ($n = 1; $n <= $totalPages; $n++) { //Add the if($n != $Page) if($n != $Page) echo "<a href='?page=".$n."' >$n</a>"; }
  12. oops change $end = ($end > $NumRecords)?$NumRecords:$end; $start = $end-$Entries; to $start = $end-$Entries; $end = ($end > $NumRecords)?$NumRecords:$end; aka just swap them
  13. if you mean like this //setup $test1 = $mysqli->prepare("SELECT * from table WHERE username= ? AND password= ?"); $test1->bind_param('ss', $username, $pass); //to execute. $code = 'MadTechie'; $pass = 'YeahRight'; $test1->execute(); then yes
  14. $rand_keys was created from array_rand, and as the script requested 2 returns it returns them as an array ie $rand_keys[0] = 2 $rand_keys[1] = 4 the values are the index values so $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); is infact $input[0] = "Neo"; $input[1] = "Morpheus"; $input[2] = "Trinity"; $input[3] = "Cypher"; $input[4] = "Tank"; Now the 2 returns were 2 and 4 So you can now see it refers to $input[2] = "Trinity"; & $input[4] = "Tank"; i hope that clears it up
  15. Archive = keep copy of for "maybe" use later (think of it as a backup to DVDs you can't edit them directly but you still have the data) Backup = keep copy of all my current work that i need live at all time. Can you create a backup well you can..but theirs better solutions that having PHP do it all.. for example you can get software to map a *sftp to your pc with this drive letter mapped you treat it like a drive.. any file sync software will work.. If you want yo create your own filesync software.. you can do but it won't be as fast as the compiled versions (sftp = secure file transfer protocal)
  16. So you need to pull out a filename from a webpage and The file name always ends with _YYYYMMDD.zip how about an over complicated untested script <?php $DATA= <<<DATA <html> <head> <title>Untitled</title> <SCRIPT language="JavaScript1.2"> function poponload() { var url='http://localhost:8080/test/test_20090319.zip'; testwindow= window.open (url); } </script> </head> <body> <form method="GET" action="test.jsp" onsubmit="javascript:poponload()"> <input type="submit" name="download" value="OK" /> </form> </body> </html> DATA; if (preg_match('/\'([^\']*?(?:19|20)[0-9]{2}(?:0[1-9]|1[012])(?:0[1-9]|[12][0-9]|3[01])\.zip)\'/i', $DATA, $regs)) { $result = $regs[1]; } echo $result; ?>
  17. Okay lets assume username is a string and Field2 is a int <?php //setup $test1 = $mysqli->prepare("SELECT * from table WHERE username= ? AND field2= ?"); $test1->bind_param('sd', $username, $field2); //Note the sd thats string then digit //the username is the string and first ? //the field2 is the digit and second ? //to execute. $code = 'MadTechie'; $field2 = 5; $test1->execute(); //results printf("%d Row inserted.\n", $test1->affected_rows); ?>
  18. 1st, My first thought is how long is it going to take to upload 600gb at (whats your upload speed) ? 2nd, The quicker & cheaper option is to create two backups and give one to a family member for safe keeping.. and update go to your external then after a week or so swap drive and re-sync their old one, if you like pay them $5 per month for the hassle! 3rd, it sounds like you need an acrhive position more than a backup.. are you really updating 600gb of photos ? 4th, this is nothing to do with PHP..
  19. why now just $thetime='00:00:10'; $dateTime='0000-00-00 11:11:00'; echo date('d-M-Y H:i:s',(strtotime($dateTime) + strtotime($thetime) ) );
  20. when you access the files use the path in relations to where the current file is, to find the path of the current file do dirname(__FILE__)."/"
  21. Okay the problem is mainly due to the 3 extra spaces at the stop of the file before the <? heres a working version i also changed how you get the random item from the array [attachment deleted by admin]
  22. It appears your echoing that line so change form (i assume the line looks like this) echo '<div id="backgroundImage"><img src="generative.php?<php echo time();?>"></div>'; to echo '<div id="backgroundImage"><img src="generative.php?'.time().'"></div>'; EDIT: also the generative.php? has errors can you post the first 10 lines
  23. try this update change $totalPages = ceil(count($fulllog)/$Entries); $end = $Entries*$Page; $start = $end-$Entries; to $NumRecords = count($fulllog); $totalPages = ceil($NumRecords/$Entries); $end = $Entries*$Page; $end = ($end > $NumRecords)?$NumRecords:$end; $start = $end-$Entries;
  24. its probably due to cache add the following to the image script header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); //passed date header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); if that failed then the old fall back is <div id="backgroundImage"><img src="generative.php?<php echo time();?>"></div> this make the browser thing its a different file thus forcing a reload of it
×
×
  • 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.