Jump to content

BaconBeast321

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BaconBeast321's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi there, I have many image rollovers on my pages, and I have found that the Rollover occurs a full second later after having moved my mouse over it. I'm assuming this is because I am downloading the 2nd image? These are .gifs around 1-3KB so shouldn't really be big delay. Is there a way to get a user to prep this images on initial load of the page?
  2. Hi, not quite sure what you mean by automatically.... But if you have an auto_increnment column, just query ORDER BY DESC 0,1 (Chooses most recent) then delete that..... if you want to do it automatically, I guess you could have an actual date colum, then get the date from DB as a variable in php take out the ' / ' lines so it becomes an int. then just use a  if($dateofentry > "08082006") { } . ... Yeah duno if that'll work just throwing ideas around.. lol theres probably an inbuilt var class for dates in php to use in those sort of scenarios.. cant help you there though sorry GL
  3. Hi there, I have a page that when you click on a picture in firefox it opens a new window and displays the picture, but when you do it in IE it opens the window but no picture.. you can view the page here... http://www.autramping.unigroups.co.nz/viewadj.php?jc=Tarantula%20Nebula - Heres the script im using <SCRIPT LANGUAGE="JavaScript"> function openpic1()       { OpenWindow=window.open("", "newwin", "height=600, width=800,toolbar=no,scrollbars="+scroll+",menubar=no"); OpenWindow.document.write("<BODY BGCOLOR=black leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>") OpenWindow.document.write("<IMG SRC='upload/<?php echo("$jc"); echo '1.jpg' ?>' height=x'>") OpenWindow.document.write("</BODY>") OpenWindow.document.write("</HTML>") OpenWindow.document.close() self.name="main"     } </SCRIPT> <?php if($oneisthere > "0") { echo '<td class=mid align=left><img src="upload/'; echo("$jc"); echo '1.jpg" onClick="openpic1();" width="120" height="90"></td>'; } ?> The view source through IE looks like this: <BODY BGCOLOR=black leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0><IMG SRC='upload/Tarantula Nebula1.jpg' height=x'></BODY></HTML> It looks like maybe it needs  " instead of ' around the image name but if I try to add that in the script I get a php error
  4. so for the hidden form solution.... hows this... : <form enctype="multipart/form-data" method="post"> <input type="hidden" name="click" value="<img src="pictobeclicked.jpg">"> </form> then $vartobeset = $_POST["clickme"];
  5. Hi there, I want to be able to set a OnClick for a picture that runs a function that makes a variable = 1.. How do I go about doing this? I know how to do it in javascript, but this needs to be PHP. Essentially it is for the manager of the site, he can click on a button which adds like a linebreak '<BR>' or something into the news report he is making... Have tried looking around for solutions but cant find any, help much appreciated!
  6. Hi there I have users uploaded photos of any size and I have a viewing section which I want to show these pictures as thumbnails.. how do I go about doing this?
  7. Hey guys, the basics are now complete, however still one last hurdle to tackle, When the user locates this persons journal page I need to display all the pictures for this journal. Now when the user uploaded the pictures they were stored in a folder /upload and each picture had the name of the journaltitle then a number e.g beachtrip1.jpg beachtrip2.jpg How do I first check to see if pictures were uploaded and then display them?...
  8. Hi there. Here is my code: (It is straight from a tutorial site) Makeaj.php ------------ <form action="makeajcom.php" method="post"><br> Type (or select) Filename: <input type="file" name="uploadFile"> <input type="submit" value="Upload File"> </form> Makeajcom.php --------------- <?php move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],       "/uploads/{$_FILES['uploadFile'] ['name']}") ?> ///////////--------------////////////// I figured it would be easy to get this bit done, but it doesnt seem to be working! uploads is a directory below both php files.. Any help would be really appreciated
  9. Hi well I've gone away and tried to use the tutorial but I am having no luck.. Here is my script: --makeaj.php-- <form action="makeajcom.php" method="post"><br> Type (or select) Filename: <input type="file" name="uploadFile"> <input type="submit" value="Upload File"> </form> --makeajcom.php--- <?php move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],       "../journalpics/{$_FILES['uploadFile'] ['name']}") ?> The directory journalpics is below the dir of these php files.. still... the files arent being uploaded into that directory..
  10. Hi there, still working on my site... and I am up to the final and hardest part :/ I have a section where users submit a journal with pictures for that journal. I have a journal search sytem by username and genres..-- Now, I want to be able to have a user upload a picture for a journal and have it upload the picture to a directory with the $journalname as prefix and incremental n.o as suffix. e.g (myadventure03.jpg). Then I want to add this label to the DB. So that, when I click on a journal to view I can get it to display all pictures for that journal by a MYSQL search with journal (column) = $journalname for example... -- I've looked around for tutorials on this and tried to do it myself but I am having a bit of trouble, any help would be greatly appreciated.. Thanks,
  11. will try andy... it is already one page
  12. Hi that doesn't seem to be working, JC has a value its not just not getting values for the other parts of the array :/
  13. Hi Yesideez, thanks very much for your reply, have followed your methods and have successfully got it working for the most part (as usual :P). The page is now displaying the 4 latest journals for that user and then sets a varaible jc=jtitle and reloads the page, which then shows the user the journal they choose!!! :D :D For starters, I set the Jtitle to equal "1" so then when it carried over, jc=1 then on reentry of the script it hit the if(isset(jc)) section and displayed the journal. This worked fine when Jtitle was a number, but as soon as I changed it to say "My First Journal" or any word combination upon reentry, it came up with this : ------------------------------------------------------------------------------------------------------ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lifenzc/public_html/phppractice/viewadj.php on line 285 ------------------------------------------------------------------------------------------------------ So I figure somewhere along the line I have used a "=" sign or something that only works for numbers? Here is the script I have used, haven't yet been able to figure it out. <?php $do=mysql_query("SELECT * FROM journals ORDER BY date DESC LIMIT 2"); while ($fetch=mysql_fetch_array($do)) { $dispd = $fetch[jtitle]; echo '<TD align=center class=maintable><a href="'.$PHP_SELF.'?jc='.$dispd.'">'.$dispd.'</a></td>'; } ?> Then inside the if jc has a value section upon reload of page: <?php if ( isset($jc) ): ?> <TR><TD align=center class=menutitle> <?php $showja=mysql_query("SELECT * FROM journals where jtitle=$jc"); while ($jja=mysql_fetch_array($showja)) { $showjoud = $jja[date]; $showjout = $jja[jtitle]; $showjouj = $jja[jadvent]; $showjouu = $jja[userswj]; } ?> </td></tr> Any ideas? = D
  14. [!--quoteo(post=378573:date=May 30 2006, 09:57 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 30 2006, 09:57 PM) [snapback]378573[/snapback][/div][div class=\'quotemain\'][!--quotec--] Glad to help [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] 2. Maybe the field is not named 'username'? Did you try to open the HTML source and see what is in there? 3. Yes. You need to fetch it as usual to turn it into a variable. [/quote] Hi have been ticking away all day, managed to get number 2 going there was a simple field name era as you pointed out. I now have a system going where users can upload make "adventure journals" with text, (photos soon to be added). And I have a form that you select the user you want to views journals, it really is getting there! fantastic! Still here are a few problems I havent been able to solve all day: ------------------ 1. "You can use "SELECT * FROM table ORDER BY date ASC LIMIT 1" On page one of viewing this users journals I want to have a table grid of say 4 each grid with a picture and title of the journal that they want to view. So I want to select oder by date and then pick out the newest, 2nd newest, 3rd newest e.t.c automatically and assign a variable to each one. I don't really understand this ASC LIMIT 1 concept. So therefore when you view a users journals you see the newest ones on the front page of that section. 2. Related to 1. When the users clicks on the photo or JTITLE they want I need it to set a variable to set a variable to equal something, is there like an on mouse click function do this command? And would it be best to use a href and reload the page with a variable=something way, or is there a php button or something I can use loll... :/ 3. Is there a way to clear the POST_DATA or make a variable equal nothing at the end of a page. I have found upon refreshing a page after clicking on a form which assigns post_data to variables, it uploads the previously posted data again! most annoying... If there is a way I will use "<?php if ( isset($variable) ): ?>" statement to control whether to add data to the DB. ----------- The questions never stop, I will keep tucking away at these tomorrow but any help would be great gets me out of the rut of brooding over a problem for hours on end :/ Thanks again and again poirot
×
×
  • 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.