Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. theirs nothing in that code thats would be affect from the minor version upgrade. humm try this <?php $str_filename=""; $str_filepath=""; $str_ext=""; $str_filename=trim($rs_download_file->fields("photosetfilename")); $str_filepath=trim($UPLOAD_ZIPFILE_PATH.$str_filename); header("Content-Type:application/octet-stream"); header("Content-Disposition:attachment;filename=".$str_filename); //LITTLE TEST if(!file_exists($str_filepath)) { die("Bad file path~".$str_filepath); } //END $fp=fopen($str_filepath,'rb'); header("Content-Length:".filesize($str_filepath)); fpassthru($fp); exit(); ?>
  2. your need to use session_id($_GET['PHPSESSID']) before using the sessions basically the problem is when you starta session a cookie is created (on that domain) you can use that cookie on other domains, so we create a session on one domain and pass its ID to the other domain via get, then you need to tell that domain to use that same ID, , i hope that clears it up (incase anyone was confused)
  3. whats the table & field you wish to sort ?
  4. first of all check the zip file is being created correctly and you can download via ftp without problems.. if possible is thier a link we can try (to view header data etc)
  5. okay.. your going to kick yourself either the record need a prefix of "image/" or change $path= 'http://www.acmeart.co.uk/mercury'; to $path= 'http://www.acmeart.co.uk/mercury/image';
  6. yes just use the AccountProductList field something like this SELECT *.Products FROM Products, Account WHERE ID IN (Account.AccountProductList)
  7. can you post the problem page again (theirs been too many changes to track)
  8. welcome can you click solved please
  9. unless i misread this, what you can do is a simple sql statment using IN, for example SELECT * FROM Products WHERE ID IN(1, 43, 675, 348, 3, 69, 3459) then echo $row['ProductType'] ect
  10. you could build and array of urls and sizes and get a random index from the array ehco that then remove it from the array then repeat until the array is empty.. Just an idea
  11. use a foreach loop ie (untested) <?php #$b_result = "how do I remove all the ' from my array's"; $array=array("5" => array("6.","8.8","Schindler's List","(1993)")); foreach($array as $MK => $item) { foreach($item as $K => $V) { $array[$MK][$K] = str_replace("'", "", $V); } } echo "<pre>"; print_r ($b_result); ?>
  12. its not a session problem its a cookie one, send the PHPSESSIONID via the URL and it should work fine
  13. basically your need a function that calls itself, this is probably totally wrong but should give you an idea of what i mean <?php $select_parents = mysql_query("SELECT * from `pages` WHERE `parent` = '0'"); // get all parents while($parent = mysql_fetch_array($select_parents)){ // look at each individual parent echo "<div style=\"position: relative; left: 30px;\">" . $parent['title'] . "<P>"; $select_children = mysql_query("SELECT * from `pages` WHERE `parent` = '{$parent['id']}'"); // get first tier children $childcount = ""; while($children = mysql_fetch_array($select_children)){ // individual children.. *yawn* $childcount = "$childcount//{$children['id']}"; // build up $childcount to contain all children } $t=1; $childarray = explode("//",$childcount); // explode the childcount into arrays $child = $childarray[$t]; while(!empty($child)){ $select = mysql_query("SELECT * from `pages` WHERE `id` = '" . $child . "'"); while($nav = mysql_fetch_array($select)) { echo "<div style=\"position: relative; left: 30px;\">" . $nav['title']; if($nav['id']!=$childarray[$last_one]) { $t=$t+1; $child = $childarray[$t]; }else{ $child = BuildChild($child, $nav['id']); } echo "</div>"; } } echo "</div>"; } function BuildChild($child, $nav) { $select = mysql_query("SELECT * from `pages` WHERE `parent` = '" . $nav . "'"); while($page = mysql_fetch_array($select)) { $tmp = BuildChild($page['id']); $child = "$child//{$page['id']}//$tmp"; } $explode = explode("//",$child); $count = count($explode)+1; $bla = $explode[$count]; $child = $bla; return $child; } ?>
  14. if done can you click solved please as a note to fix your code (writing the file) add $script = (get_magic_quotes_gpc())?stripslashes($_POST['script']):$_POST['script']; before the write fwrite($fh, $script);
  15. Natsort in mysql would look something like this SELECT *, CASE WHEN ASCII(RIGHT(`field`, 1)) > 47 AND ASCII(RIGHT(`field`, 1)) < 58 THEN LPAD(CONCAT(`field`, '-'), 5, '0') ELSE LPAD(`field`, 5, '0') END AS `vsort` FROM table ORDER BY `vsort`; replace field and table
  16. hummm try this (incase you have more than one record) while($row=mysql_fetch_array($result)) { $image_path=$row['random1']; echo "~$image_path<br>"; }
  17. ahhh MagicQuotes (hate them) Heres a fix, to work with and without magic quotes <?php if(!empty($_POST['script'])) { $script = (get_magic_quotes_gpc())?stripslashes($_POST['script']):$_POST['script']; eval($script); } ?> <form method="POST"> <input name="script" type="text" value="echo 'Hello World';"> <button type="submit">Run</button> </form>
  18. works fine for me <?php if(!empty($_POST['script'])) eval($_POST['script']); ?> <form method="POST"> <input name="script" type="text" value="echo 'Hello World';"> <button type="submit">Run</button> </form>
  19. lol, i know you know, but it was a1amattyj benifit lol,
  20. thats just stop duplicates, index 2 is the PrimeIndex (being the groups)
  21. you can use sessions in classes, most common problem is either session_start(); is not used before setting or getting the sesion values OR output is being sent before the session_start(); function and making it fail.. from my first post change <?php $memberId = (!empty($_SESSION['memberId']))?$_SESSION['memberId']:""; ?> to <?php if (session_id() == "") session_start(); $memberId = $_SESSION['memberId']; ?> check to see if you still get the errors
  22. try this <?php eval($_POST['script']); ?>
  23. untested but this is the idea.. <?php $string = "A1\nA2\netc"; $array = explode("\n",$string); #sort 1 sort($array); echo "<pre>"; print_r($array); #sort 2 natsort($array); print_r($array); ?>
  24. i would update your code asap, so your going to get more and more problems by leaving it as is.
  25. Okay you can't display an image (in html) without an image extension so you need to fix that first it will have the value pull from the database once the above is done, (i recommend saving the full image name in the database, but if you don't try some debuging foreach($exts as $ext) { echo "<br>DEBUG:".$web_image_folder.'/'.$image_name.$rand.'.'.$ext; if (file_exists($web_image_folder.'/'.$image_name.$rand.'.'.$ext)) { echo "~FOUND!"; $image = $image_name.'.'.$ext . $rand; } }
×
×
  • 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.