Jump to content

comports

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

comports's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Again Chris. It seems to work if you "hard code" the string but I'm calling it from a text file. The only output I get is "Sometimes it works and sometimes it don\'t" My code is [code] $r_array=file("../cane-corso/images/text/".substr($files[$num],0,-4).'.txt'); echo $mQuotePath[0]; $query = $r_array[0]; parse_str($query); $string=$text; addslashes($string); echo $string;[/code] What am I doing wrong here. Thanks
  2. Thanks Chris but I don't follow that.. In my text file have for example: [quote]Sometimes it works but sometimes it dont..[/quote] but I want it print out the "dont" as don't with the apostrophe. If i change my txt file to read "Sometimes it works but sometimes it don't." it breaks because of the '. Is there no simple way to include these and just display as a string. i.e. "don\'t" (even thought that don't work). Thanks Ash
  3. HI All, I need some help with a very small issue. I have some php code that reads stuff (text) from a txt file and then displays it on a page. All this is fine until I use the ' (apostrophe) character which then breaks the code. I guess it would be the same for " and $ etc.. I have tried preceding it with a \ (backslash) but that did nothing to help.. Any clues.? Thanks Ash
  4. Thanks Taith, Your are a superstar..! I had to mod it a bit to get it move to the next image but that's ace. See it working here:- [url=http://www.comports.net/cane-corso/pictures.php?folder=../cane-corso/images/gallery/&show=y&num=1]http://www.comports.net/cane-corso/pictures.php?folder=../cane-corso/images/gallery/&show=y&num=1[/url] and click on slideshow.. Thanks a Million Ash
  5. Thanks - Changed the code but it now just refreshes and show image1 each time and does not step through to the next image..?? :'(
  6. Thanks Taith, It's very interesting but I guess it goes back to the "Firefox does not process php" line. My source does contain the correct line [code]<META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=2">[/code] but also contains the same code with each of the image numbers in it so I get: [code] <META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=2"> <META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=3"> <META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=4"> <META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=5"> <META HTTP-EQUIV="refresh" content="3; URL=?folder=../cane-corso/images/gallery/&num=6">[/code] etc... all the way to the last imagenumber in the array.. I guess it reads the last line and refreshes but using the last number..! Is there a way to stop this..?
  7. Hi Perad, Thanks fo rthe quick response. My code.. [code]<?php error_reporting(0); $folder = ("../cane-corso/images/gallery/"); $num = $_GET["num"]; $dir = opendir($folder); print"<HTML><HEAD><TITLE>Cane Corso Slide Show</TITLE><META NAME=\"Author\" CONTENT=\"Ashley Byrne\"><META NAME=\"Keywords\" CONTENT=\"Image Gallery Slideshow\"><META NAME=\"Description\" CONTENT=\"\"><link rel=\"stylesheet\" href=\"style2.css\"></HEAD><BODY bgcolor=\"#FF99CC\"><center><table border=\"5\" cellspacing=0 cellpadding=0 width=\"100%\" height=\"100%\" bgcolor=\"#FF99CC\"><table bgcolor=\"#FF99CC\">"; $dir = opendir($folder); $i=1; while ($a = readdir($dir)) { if($a != "." && $a != ".." && $a != "text"){ $files[$i] = $a; ++$i; } } $total = count($files); if ($num==""){ $num=="1"; } // resize the image if its too big $maxwidth="600"; list($width, $height, $type, $attr) = getimagesize($gallery.$folder.$files[$num]); if($width>$maxwidth){ $widthpc = round(($maxwidth/$width)*100); $width = round(($width*$widthpc)/100); $height = round(($height*$widthpc)/100); $attr="width=".$width." height=".$height; } Else{ $attr="width=".$width." height=".$height; } print "<tr><td><center><b>".substr($files[$num],0,-4)."</b>&nbsp;&nbsp;&nbsp;&nbsp;(". $num. " of ". $total.")</b></td></tr>"; print "<tr><td><center><img src=\"".$gallery.$folder.$files[$num]."\" ".$attr." border=1><br></td></tr>"; print "<tr><td><br><center><a href=\"javascript:parent.window.close()\"><font color=\"white\">--|  End slideshow  |--</a></td></tr>"; while ($num < $total){ $num = ($num+1); print "<META HTTP-EQUIV=\"refresh\" content=\"3; URL=?folder=".$folder."&num=".$num."\"></td></tr></table>"; } ?>[/code]
  8. HI Folk, New to this Forum and fairly new to PHP. I have an issue with firefox and wonder if you can help. Quite simple really. It reads the contents of a folder into an array and display number 1. Increments the variable, refreshes the page and displays image 2 and so on. All fine in IE. BUt when I view it in Forefox it displays image 1, refreshes and jumps straight to the last image in the folder....?? Help.. ??? ??? Thanks in advance. Ash
×
×
  • 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.