Jump to content

micky1955

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

micky1955's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. solved thanks. needed $dirchoice = $_GET['dirchoice']; for some reason - never needed it before!! have discarded php_self as suggested and am simply using the page name as follows <li><a href=<?php echo("photo_gallery3.php?dirchoice=" . $darr[$x]) ?> ><?php echo(str_replace("_"," ",$darr[$x])); ?></a></li> Many thanks to both of you who replied. without some help from people such as yourselves it would be much, much more difficult to learn how to use a new language properly.
  2. hi cyberRobot, thanks for looking at my problem. i see what you mean about $php_self and will stop using it altogether. my problem is that the directory name doesn't seem to be getting stored in the variable $dirchoice. this system used to work well. the site has not been used for some time but we want to bring it back online.
  3. Hi trq, thanks for looking at my problem. i've tried what you suggested (<a href="?dirchoice=<?php echo $darr[$x]; ?>">) with no luck. the directory name is not being stored in the variable $dirchoice. this bit is in photo_galley3.php and includes show_pics.php which i've shown below. if (isset($dirchoice)) { echo("dirchoice set"); $small_pic_dir = $dirchoice . "/" ."tns/"; /* $full_dir stores becomes chosen dir name plus thumbnail */ $full_dir="/home/ddm993c/public_html/1stwest/images/" . $small_pic_dir; $count = 1; $mydir = dir($full_dir); ?> <span class="text12"><p style="color:#CC0000"><?php echo(str_replace("_"," ",$dirchoice)); ?></p></span> <?php include ("show_pics.php"); echo "</table>"; $mydir->close(); } else { echo("dirchoice not set"); $dirchoice = "Big_Pit"; $count = 1; $small_pic_dir = $dirchoice . "/" ."tns/"; $full_dir="/home/ddm993c/public_html/1stwest/images/" . $small_pic_dir; $mydir = dir($full_dir); ?> <span class="text12"><p style="color:#CC0000"><?php echo(str_replace("_"," ",$dirchoice)); ?></p></span> <?php include ("show_pics.php"); echo "</table>"; $mydir->close(); } THIS IS show_pics.php: <?php while(($file = $mydir->read()) !== false) { if ($file !== "." && $file !== "..") { if ($count == 1) { $count++; $fstring = substr("$file", 0, -4); $smallpic = $small_pic_dir . "$file"; $smallpic = "images/" . $smallpic; $largepic = $large_pic_dir . "$file"; echo ("<table border=0 cellpadding=0 cellspacing=10 style=bordercolor=#111111 width=100%> <tr> <td width=25% align=center>"); ?> <img src="<?php echo($smallpic); ?> "width=240 height=172 /> <?php echo($fstring);?> </td> <?php } elseif ($count == 2) { $fstring = substr("$file", 0, -4); $smallpic = "$small_pic_dir" . "$file"; $smallpic = "images/" . $smallpic; $largepic = "$large_pic_dir" . "$file"; echo ("<td width=25% align=center>"); ?> <img src="<?php echo($smallpic); ?> "width=240 height=172 /> <?php echo($fstring);?> </td> <?php $count++; } elseif ($count == 3) { $fstring = substr("$file", 0, -4); $smallpic = "$small_pic_dir" . "$file"; $smallpic = "images/" . $smallpic; $largepic = "$large_pic_dir" . "$file"; echo ("<td width=25% align=center>"); ?> <img src="<?php echo($smallpic); ?> "width=240 height=172 /> <?php echo($fstring);?> </td> <?php $count = 1; } //end if ($count == 1) } // END if ($file !== "." && $file !== "..") } // END while(($file = $mydir->read()) !== false) ?>
  4. Hi all, help needed please. our site is http://www.1stwestpont.org.uk/photo_gallery3.php i am using the below code to display a menu of image directories stored on the server. on choosing an option it should ( and it used to! ) give the url for another bit of code to display the images. the directory names are stored in the array $darr[ ] having read the image directory. $lmen is just the number of directories. the variable $dirchoice is used to pass the value chosen to the display code but doesn't seem to be passed anymore. is this something to do with a newer version of PHP on my server perhaps? our site is http://www.1stwestpont.org.uk/photo_gallery3.php. i hope someboy can help me - this was my first foray into PHP and the code may not be the best but and as i said before, it used to work!! yours hopefully,, Micky <ul> <?php for ($x=0; $x<$lmen; $x++) { ?> <li><a href=<?php echo("$PHP_SELF?dirchoice=" . $darr[$x]) ?> ><?php echo(str_replace("_"," ",$darr[$x])); ?></a></li> <?php } ?> </ul>
  5. this works for me - got it from another member a while back Header("Cache-control: private, no-cache"); Header("Expires: Mon, 26 Jun 1997 05:00:00 GMT"); Header("Pragma: no-cache");
  6. Thanks for the reply - tried both versions but for some reason they screwed up my menu formatting in a big way. Anyway, a bit rushed so i went for the easy route and used str-replace to replace the underscores from the folder names with spaces - it looks better in the menu list. when 've more time i'll have another look at this and see why it messed up the css formatting. Thanks again - Regards from Doug. aka Micky1955
  7. Help please - it's doing my head in! i'm probably missing something here but have searched for an answer to no avail. i'm using folder names on the server as links in a menu - to display thumbnail pics in chosen folder. works fine as long as the folder name is in this format - 'abc_def_ghi_jkl' but not in this format 'abc def ghi jkl'. the array $darr[] holds the folder name and will show it ok as a link but in the code shown $dirchoice only contains the folder name as far as the first space - ie. abc Any ideas please? <li><a href=<?php echo("$PHP_SELF?dirchoice=" . $darr[$x]) ?> ><?php echo($darr[$x]);?></a></li>
  8. ;D many thanks irken, just tried your solution and problem appears to be solved!
  9. Thanks ProjectFear. but is there any way to force the browser to [color=green]clear its cache[/color] by programming? Micky.
  10. you can use AND & OR as follows: $search1 = "Batman"; $search2 = "Returns"; SELECT * FROM DBASE WHERE Title LIKE '%$search1%' [color=red]OR[/color] Title LIKE '%$search2%' ; SELECT * FROM DBASE WHERE Title LIKE '%$search1%' [color=red]AND[/color] Title LIKE '%$search2%' ; using [color=red]LIKE[/color]  with the [color=red]%%[/color] option means that for a result the search text must be found somewhere in the field.
  11. Thanks for the replies people could anyone please tell me how to [color=red]clear the cache [/color] or use [color=red]"&timestamp=113768465"[/color] ? Micky.
  12. seems good one for use of database "relations" offered by mysql. two tables one for members and one for friends linked by their id numbers. that way you only have to store a member once and all his friends can be found by their friendowner's id. good luck, Micky
  13. thanks for the reply Artacus. tried that - works when adding a record. still have prob with amending - if you amend again record that was recently amended form will show old data although new was shown when displaying all records - weird init? url is [url=http://www.ddm.org.uk/case.php]http://www.ddm.org.uk/case.php [/url]  if anyone would please have a look - only test data used so do what you like with it. code for the editing form shown below [code]<?php $sql = mysql_query("SELECT * FROM `filmdata` WHERE `ID` = $editfilm"); $row = mysql_fetch_array($sql); $existyear=$row[Year]; $existtitle=$row[Title]; $existgenre=$row[Genre]; $filmid = $editfilm; ?> <table class="search"> <tr> <td class="search"> <FORM ACTION="<?php echo($php_SELF); ?>" METHOD=GET> Amend Data - &nbsp&nbsp </td> <td class="search"> <INPUT TYPE=TEXT NAME="newyear" VALUE="<?php echo($existyear); ?>" size="4" maxlength="4"> </td> <td class="search"> <INPUT TYPE=TEXT NAME="newtitle" VALUE="<?php echo($existtitle); ?>" size="40" maxlength="40" > </td> <td class="search"> <INPUT TYPE=TEXT NAME="newgenre" VALUE="<?php echo($existgenre); ?>" size="40" maxlength="40"> </td> <td class="search"> <INPUT TYPE=SUBMIT NAME="submitfilm" VALUE="CANCEL"> </td> <td class="search"> <input type=hidden name="editformdone" value=1> <input type=hidden name="delid" value=<?php echo $filmid ?>; > <INPUT TYPE=SUBMIT NAME="submitfilm" VALUE="SUBMIT"> </td> </FORM> </tr> </table> [/code]
  14. am learning PHP, slowly, but it takes a while at my age! have written code for database maintenance - add, edit, delete & search. all works fine apart from one problem - for instance after adding, deleting or editing a record the code to read & display the data shows the updates ok.  When running that same piece of code again it does not show the updates unless the page is refreshed. i am confused as to why this happens! data reading code is below. is this something to do with caching? if so why does data display correctly the first time? any help will be much appreciated. [code] if( $searchtext=="") :              // NO SEARCH REQUESTED - SELECT ALL $result = mysql_query("SELECT ID , Title , Genre, Year FROM filmdata ORDER by `Title`"); else: $result = mysql_query("SELECT * FROM `filmdata` WHERE Genre LIKE '%$searchtext%' order by `Title`"); $searchtext=""; ENDIF; $numfilms=mysql_num_rows($result); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); }[/code]
  15. :) many, many thanks people! tried both methods and they worked fine. i just [i][b]knew[/b][/i] there had to be a way to do it but counld not get it right! had even got to the point of thinking about saving the data in a tem text file! Thanks again, Micky
×
×
  • 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.