Jump to content

efficacious

Members
  • Posts

    271
  • Joined

  • Last visited

    Never

Everything posted by efficacious

  1. my first suggestion would be to separate the PHP from the display code.. makes it very difficult to follow. I'm not sure but it seems like some vars are not in loops that should be or vice versa.. very messy.
  2. they do.. the passwords are stored in the DB hashed, when the user logs in the typed password is then hashed and compared to the hash in the DB. Its really nice method because the only person who ever knows what the password is, is the user who typed it.
  3. thats because JavaScript is run by the client after the page has been served and PHP runs serverside BEFORE the page is served.. your trying to first run the javascript and then run the php. You need to process the javascript and use that to create a redirect of somesort, using a GET method or post method to submit the data to PHP. the variable $javaoutput does not hold the result of the JavaScript.. it holds the script itself. when you: echo ($javaoutput); the result is : <script type='text/javascript'> var amzn_wdgt={widget:'Search'}; amzn_wdgt.tag='powlawofatt-21'; amzn_wdgt.columns='3'; amzn_wdgt.rows='10'; amzn_wdgt.defaultSearchTerm='10 mp 5x zoom'; amzn_wdgt.searchIndex='Electronics'; amzn_wdgt.width='542'; amzn_wdgt.showImage='True'; amzn_wdgt.showPrice='True'; amzn_wdgt.showRating='True'; amzn_wdgt.design='2'; amzn_wdgt.colorTheme='Default'; amzn_wdgt.headerTextColor='#000000'; amzn_wdgt.outerBackgroundColor='#FFFFFF'; amzn_wdgt.marketPlace='GB'; </script> <script type='text/javascript' src='http://wms.assoc-amazon.co.uk/20070822/GB/js/AmazonWidgets.js'> </script> instead of the values you expect returned by that script..
  4. np good luck bro.. if you get stuck come on back.
  5. you'll still show the photo.. when you pull the URL of the photo out of the database you'll just plug that into your HTML template. and allow the browser to handle it normally.. <img src='<?php echo($IMAGEURL) ?>' /> its the same thing you do for the image gallery only the page is specifically designed to view everything about that one photo. shoot the hardest part of this is writing the html/css for the page display lol. these forums work quite the same way.. take a look at the URL on for this page.. notice the topic ID being sent searches the database for posts with that ID attached to them and then after some organizing of the results displays it on the page via an HTML template with all the DB data plugged into it.
  6. theres not a function persay.. perhaps that was a poor choice of words.. when your gallery script prints out the links to the photos w/e change that link so that it points to a php page and using the GET method attach the ID of the photo... in the php page you'll write some code to pull the info from the DB of the photo that goes with the ID sent and also the comments that go with that ID. Then populate the html template with the information from the DB. Its classic retrieve/display.
  7. well you keep the photo information in the DB right? such as location on the server and size type blah blah right? well what you do is make a PHP page specifically for viewing just a single photo.. say viewPage.php in viewPage.php you would recieve the ID of the picture selected to view and using that ID pull the rest of the pictures information from the DB. after its pulled you will plug that data into an html template of some sort and display it so the user. quite simple really. as for comments.. they would have a spot in the DB as well with a ID that corresponds with the ID of the photo they are for. so that you can retrieve them at the same time and populate the html template
  8. you could do a redirect after the sumbmission so that its already past the point of return.. just carry the result data with you to the next page.. that way if the user refreshes.. nothing (on that page) would have been submitted so the submission will never have to be repeated
  9. yea you will basically write a class or function w/e you want and then each time open a link to a ViewPic.php page that populates the class with the details of the photo and the image comments blah blah something like viewPhoto.php?id=14324131243 take that id number pull the info for the picture.. populate the template with the information and show it. is that too brief an explanation?
  10. with? ah nevermind i see the how question in there now.. whats that code display? a list of links to the pictures?
  11. lol i'm going to go ahead and escape this line of convo as you make no sense and I don't want to fill the op's thread up trying to debate it with you. btw the only time the data is lost is after 5 times of resending the data(refreshing page after submission).. if you do exactly as the op instructed before.. Fill out the form> submit > see result > Click Back button > refresh page> repeat it>> .... works everytime.
  12. yea a template sounds like what you would use in that situation.
  13. The point is to write reliable code that doesn't fail. And yes, the <form tag> I posted above doesn't need to be escaped, just input tags. What? Whats unreliable about it? In what situation would you NEED to resubmit the form 5+ times?
  14. i would look into using some sort of SQL regular expressions http://dev.mysql.com/doc/refman/5.1/en/regexp.html wish i could help you more this is a good thing to learn how to do.
  15. what does it matter if after 5+ refreshes it drops the data? I'd leave the website if I had to submit more then once? j/w plus you could always keep track of the data with simple php scripts neway.
  16. you could try setting a session variable to flag that the form has been submitted once and then when the page is refreshed you can use php to hide the form or w/e if(isset($_SESSION['FormSent'])) { //No Form } else { //Form } ? maybe?
  17. well then you need to contact them and ask them of the format they expect the data don't you think? the first part about you receiving the data is irrelevant to this issue.. the issue is that you need to send the data to someone else. We have already established that you have it. I can't imagine that they only take one email at a time...
  18. well you can't just do somepage.php?var=thisVar,thatVar,etcVar so you'll either have to give a unique name for each value or concatenate the string and break it down on the other end. thats why i suggested the POST method instead of GET so you don't have to use the URL in the first place. Plus you can pass much more data with POST while GET method its limited characters.
  19. i could be wrong but I believe you can still send variables using the POST method to external sources.. <form action='www.domain.com\somePage.php' method='POST' > <input hidden name='var1' value='someValue' /> ect...
  20. is this a css issue? the arrays look fine to me... seems like your issue is with html/css formatting.. this section: for($i=0; $i<count($tableRow); $i++ counts the entire array instead of the number of values. the array looks double like that because it is.. so you can call the value by either: yourVar[integer] or by yourVar['DB_FieldName']
  21. well you have to first check which source is needed and then print accordingly... if(thisSource) { print_video_thumb($post) } else { tern_wp_youtube_image(); }
  22. if you want to record a persons friends you could just one one field of a row called say "friendIDs" or something then just use some special symbol to concatenate them together like "5-3-4-6-7-?..." saving you some space. When you need to use the ID's to pull friend info from the database.. just pull this long string out and break it apart using explode() method.. now you have all your id's in an array to use yay. same thing for the online thing.. just mark the user as online with a flag in the DB under say "online" field w/e , then while your retrieving friend information you can also do a check for which of those friends is online. ' you don't wana get in the habit of making a bunch of different tables in a database for the same thing.. like a user.. just use one table for users giving them each their own row.
  23. could you post the html source of one of the links in question. (the generated links)
  24. well you wouldn't store a session in a table.. you just add: session_start(); to the top of your php docs.. then when you want to log the user out just: session_destroy(); if you want to show them as online you can just put a flag into their row of the DB.. flagging that they are online. remove the flag when they logout
  25. is this going to be building a bunch of div's inside of divs? if you don't end the div everytime thats what your ending up with. maybe i misread.
×
×
  • 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.