Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. you can google this and find many results, but basically you will set the mysql offset and limit to variables, and when a page is clicked, set the offset to (page_number * number of things per page) and the limit to (page_offset - number of things per page).
  2. more than likely its a custom php.ini for the server, the directive will need to be added.
  3. "order" is a mysql reserved word, and cannot be used in a query unless it is wrapped in back ticks.. series='American Pie',`order`='1' WHERE id='13' http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
  4. are you using a database to store this information? a little more information on the subject would be helpful. I'm not. Basically I have a file upload page and on that page there's the title, description, image and file fields. When a user clicks submit a second page, process.php, uploads the file and image and puts the file into the files directory, the image into the pictures directory. Then, using a default template and str replace, the description, title and username are filled out. The picture is sourced from the picture directory and the download link from the files directory (again using str_replace). Although I do have a MySQL for the users I'm not using a database for the files. Only the three php pages, upload, process and template. Any ideas? Thanks! the most efficient way to do this is by using a database in combination with some AJAX to store the necessary data into a table, and use the table to display the information to the user. If you aren't using a database for this, how are you storing the files description, name, and title for later viewing?
  5. are you using a database to store this information? a little more information on the subject would be helpful.
  6. yes, if you use the code I posted you should not receive any errors, I think that we are over complicating this. When it comes down to it, it's a title of the document, which most people do not notice/care about anyway. The best approach for something like this is to use the simplest method possible, which, from the information that you gave me earlier, would be to set the titles of each page statically. Don't give yourself a headache over something that is really not very important.
  7. the above code is not syntactically correct, if (isset($_GET['what_page']) { $what_page = (int)$_GET['what_page']; if($what_page > 3 || $what_page < 0) { $what_page=0; } } the code that litebearer posted is close to a solution. However, there are several ways to do what you are attempting to do, once you have the full grasp and understanding on what you are trying to accomplish, we can better assist you in this.
  8. off of this comment, and no code given, why can't you simply state the title using the <title> element?
  9. the most obvious question here is, how are your pages being loaded? Is each page its own individual page? Or are the pages being loaded into one page dynamically?
  10. depends, do you want the change to affect every page or just one? just one: use the php function in the error, else use the php.ini directive.
  11. use mysql_real_escape_string on $messageorder before attempting to use its value in the query.
  12. then you do not have access to this function, however on the php manual page that I linked you to, I found a function that should do the trick, will need tweaked for your output needs. <?php function csv2array($input,$delimiter=',',$enclosure='"',$escape='\\'){ $fields=explode($enclosure.$delimiter.$enclosure,substr($input,1,-1)); foreach ($fields as $key=>$value) $fields[$key]=str_replace($escape.$enclosure,$enclosure,$value); return($fields); } function array2csv($input,$delimiter=',',$enclosure='"',$escape='\\'){ foreach ($input as $key=>$value) $input[$key]=str_replace($enclosure,$escape.$enclosure,$value); return $enclosure.implode($enclosure.$delimiter.$enclosure,$input).$enclosure; } $data=array("one","\"two\""); for ($i=0;$i<100;$i++) $data=array(array2csv($data),$i); echo "Encoded $i times...".var_export($data,true)."\n"; for ($j=0;$j<$i;$j++) $data=csv2array($data[0]); echo "Decoded $i times...".var_export($data,true)."\n"; ?>
  13. what version of PHP are you running?
  14. was going to post an example as well, little guy beat me to it.. for documentation on the function that you need, str_getcsv
  15. post the relevant code.
  16. using a database is recommended here.
  17. where is it going then? make sure that your page is Registration.html and not registration.html, case sensitive. If the correct page is registration.html, change your form action accordingly Better yet, make sure the page is Registered.html fail on my part,
  18. where is it going then? make sure that your page is Registration.html and not registration.html, case sensitive. If the correct page is registration.html, change your form action accordingly
  19. print_r($_SERVER); this will show you what keys are available on your server through the $_SEVER superglobal array. when you post what you receive, we will go from there.
  20. few things here, **in loop** 1. why do you have multiple forms in a loop? that's a no no 2. why do you have forms at all, it looks like you simply want to display the mysql data in a text field, so just have the input without the field since you are not submitting any data to the server. **in body** 1. again, you have multiple forms, when only one is needed. 2. if you are trying to get the input from "name1", you are going about it in the wrong way, encase your entire code in a form, starting the form just before the loop, and check the values when "sub_update" is clicked, as you have.
  21. Yes is can be done,mans yes you will be counting the iterations performed and create a new column with an if statement. You will want to create a variable outside of the loop, then inside of the loop, increment it each time, this value will be the number of iterations. Posting the relevant code will surely help.
  22. No this one worked hence why I didn't reply, just neglected to click solved. was given in the third post
  23. the correct regexp really needs to be posted a fourth time for you?
  24. it involves some navigation on your part, but i'll post the other tut. http://www.php.net/manual/en/langref.php really, not tuts, informative documentation rather.
  25. you can also use the "width, overflow" hack.
×
×
  • 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.