AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
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).
-
Could nayone help with this Parse error: syntax error
AyKay47 replied to Function's topic in PHP Coding Help
more than likely its a custom php.ini for the server, the directive will need to be added. -
"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
-
Listing files along with description and image?
AyKay47 replied to luigimia's topic in PHP Coding Help
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? -
Listing files along with description and image?
AyKay47 replied to luigimia's topic in PHP Coding Help
are you using a database to store this information? a little more information on the subject would be helpful. -
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.
-
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.
-
off of this comment, and no code given, why can't you simply state the title using the <title> element?
-
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?
-
Could nayone help with this Parse error: syntax error
AyKay47 replied to Function's topic in PHP Coding Help
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. -
use mysql_real_escape_string on $messageorder before attempting to use its value in the query.
-
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"; ?>
-
what version of PHP are you running?
-
was going to post an example as well, little guy beat me to it.. for documentation on the function that you need, str_getcsv
-
post the relevant code.
-
using a database is recommended here.
-
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,
-
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
-
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.
-
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.
-
Displaying results from MySQL database in columns
AyKay47 replied to alexsmith2709's topic in PHP Coding Help
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. -
Trying to restrict characters in regular expression to just a-z
AyKay47 replied to j.smith1981's topic in Regex Help
No this one worked hence why I didn't reply, just neglected to click solved. was given in the third post -
Trying to restrict characters in regular expression to just a-z
AyKay47 replied to j.smith1981's topic in Regex Help
the correct regexp really needs to be posted a fourth time for you? -
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.
-
you can also use the "width, overflow" hack.