Jump to content

BaconBeast321

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by BaconBeast321

  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. woah thanks alot it worked a treat
  4. 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
  5. 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"];
  6. 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!
  7. 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?
  8. 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?...
  9. 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
  10. 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..
  11. 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,
  12. will try andy... it is already one page
  13. 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 :/
  14. 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
  15. [!--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
  16. Hi poirot you have been most helpful. 1. The was just what it needed, now all the announcements are tucked tidily in the center :) can check it out at www.lifenz.com/phppractice/index.php youll have to make an acc tho lol :) 2. Ok I have successfully got all the usernames to display in the form! wow learning so much! 3. SELECT * FROM table ORDER BY date ASC LIMIT 1" So setting ASC LIMIT to 1 will choose the oldest? and then how to do I turn what it fetches into a variable? Do I need to use a fetch array? . Thanks.....
  17. Hi, first of all, thanks to everyone who has helped me so far, I hope I am not too annoying spamming questions like a little nublet. I am currently designing the infastructure for a set of sites I want to set up. Alot of it involves pulling data from the DB and displaying it (echo is the only way I assume?) ---- 1 ----- When echoing a long bit of text from the DB into a table is there a way to confine it somehow, the text just sprawls across horizontally and I want to contain it in a table e.t.c so it doesn't look scrappy ! Whether there is a simple table confine html solution or a different php echo solution I would love to know! ---- How do I do that? ----- 2 ----- Very similar to number 1, I have a page where privalged users can give other users announcement permmissions. Is there a way to pull all the usernames from a table and display them in a drop down form? I tried to but all the form has was a <option> Click me </option> for each variable on the menu so I couldn't figure out how to turn the respone from that unique option into a variable. - ----- So how do I display and insert info into/from the DB for drop down forms? ----- 3 ------- Last one, how do I pull the oldest array from a table in the DB using a select query, when the only date records I have in the table for each array is from date("m/d/y"). ------ How do I pull the oldest record from an array in the DB? Any help would be awesome, I am really loving PHP just getting stuck here and there...
  18. Hey, thanks wildteen that double "==" worked a treat!!! Sorry I didnt really explain myself that well, this page is for a user for announcment privlages who can add an announcment in a form. The Info from the form is turned into a variable, and since I only want their to be 10 anonuncments max on the main page, I figured running an if statement for counting and inserting values would be the way to do it. It seems to be working now, I will put in a delete function so when count brings back 10 values, it will automatically delete the oldest colum... not really sure how to do that... Thanks also for your response AndyB, I am not sure if i need all these queries but since I am so new to PHP I couldn't figure out a cleaner method of achieiving this.... I am also hoping that when I echo the announcement to a table on the main page that the data will come out ok and that I can restrict the table size so the "privalged user" doesn't have to use much html when writing the message... Thanks alot guys! :)
  19. [!--quoteo(post=377970:date=May 28 2006, 09:49 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 28 2006, 09:49 PM) [snapback]377970[/snapback][/div][div class=\'quotemain\'][!--quotec--] $count = mysql_query("select count(*) as blah from announcements"); $num = mysql_fetch_array($count); echo $num['blah']; [/quote] sweet thanks man, worked a charm! I now have one last problem, I want this select query to find out how many there are in the table then if there is zero , apply the new announcment with identifier value of 1 and if 1 in table apply 2 to the value. e.t.c I have it working but, instead of just adding one value to the array it adds all 10 lol heres the script : / <?php $count = mysql_query("select count(*) as identifier from announcements"); $num = mysql_fetch_array($count); $identy = $num["identifier"]; echo("$identy"); if($identy = ">9") { $insert10= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '11')"); } if($identy = ">8") { $insert10= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '10')"); } if($identy = ">7") { $insert9= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '9')"); } if($identy = ">6") { $insert8= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '8')"); } if($identy = ">5") { $insert7= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '7')"); } if($identy = ">4") { $insert6= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '6')"); } if($identy = ">3") { $insert5= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '5')"); } if($identy = ">2") { $insert4= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '4')"); } if($identy = ">1") { $insert3= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '3')"); } if($identy = ">0") { $insert2= MYSQL_QUERY("INSERT INTO announcements (id, username, announcements, date, identifier)". "VALUES ('NULL', '$username', '$newannounce', '$cdate', '2')"); } ?>
  20. Hi there, I am using this: $count = mysql_query("SELECT COUNT(*) from announcements"); But I don't know how to get a variable with the value of the number of record pulled from the table. I tried to echo("$count") just got resource ID#3 then tried : $countz= $count[announcements]; still nothing..
  21. Hello again, wow these forums are great! I have a variable $usernames that contains the array of all the current usernames in the DB, (quite a few). The problem is when I echo this list onto a page, it scatters the names downwards and ruins the feel of the site. (as you can imagine). I want to be able to display these usernames tidily with 5 or so per row in a table, the only way I can think of doing this is to SELECT just one username and display and repeat the process until like 999 :P Is there a better way lol ? Any help appreciated. Thanks guys Heres the website: [a href=\"http://www.lifenz.com/phppractice/setperm.php\" target=\"_blank\"]http://www.lifenz.com/phppractice/setperm.php[/a] And heres the script: <?php $result = mysql_query( "SELECT usernames FROM users"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } while ( $row = mysql_fetch_array($result) ) { $displayall = $row["usernames"]; ?> <tr><TD> <?php echo("$displayall"); ?></td></tr> <?php } ?>
  22. [!--quoteo(post=377710:date=May 27 2006, 08:48 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 27 2006, 08:48 PM) [snapback]377710[/snapback][/div][div class=\'quotemain\'][!--quotec--] header("Location:membersarea.php"); but it will ONLY work if there is nothing sent to the browser before. [/quote] Hi thanks for your help. I have tried this, but I am getting this error message: Warning: Cannot modify header information - headers already sent by (output started at /home/lifenzc/public_html/phppractice/logging.php:13) in /home/lifenzc/public_html/phppractice/logging.php on line 61 ---- The problem is I only want it to go to the next page once $username has a value, because that means the login has been verified from the DB. Here is the script: (It did have html/body/head in it but I took it out) <?php session_start( ); session_register("username") ?> <?php $conn = mysql_connect("llol","lol","lol"); $db = mysql_select_db("lifenzc_TestDataBase"); $username = $_POST["username"]; $password = $_POST["password"]; $result = MYSQL_QUERY("SELECT * from users WHERE usernames='$username'and password='$password'") or die ("Name and password not found or not matched"); $worked = mysql_fetch_array($result); $username = $worked[usernames]; $password = $worked[password]; $email = $worked[email]; $fetch = MYSQL_QUERY("SELECT * from users WHERE usernames='$username'and id != '$password'"); while ( $row2 = mysql_fetch_array($fetch) ) { $fetched = $row2["usernames"]; $fetched2 = $row2["id"]; } if ( isset($username) ) { header("Location:membersarea.php"); } ?>
  23. Hi there, I have a site with a login that goes to a page logging.php to process data, then I want it to go to membersarea.php afterwards.. My IF/ELSE statement is the following: <?php if ( isset($username) ): ?> (if username has a value) ********************************************************* -------------------------------------------------------------------------------------------- I need a function here that automatically takes the user to membersarea.php ---------------------------------------------------------------------------------------------- *********************************************************** <?php else echo("Not logged in!"); ?> Any help would be awesome! I haven't been able to find the function to do this.
×
×
  • 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.