-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
What were you searching with? It's the first result on Google for "php zip", and entering "zip" into PHP.net's search you're taken straight to it.
-
Can you provide a var_dump() of $form['catcher_id'] so that we know what you're working with? Could you also explain what you want to do and what's not working?
-
First I'd identify which version of Firefox is causing the problem, which OS they were using, etc. Try to find the common variable between those users, then try to recreate the error. You can't fix something when you don't know the cause of the problem.
-
You may want to come up with a more meaningful name for it, but try this function: function removeDecimalAndToSixPlaces($x) { list($number, $decimal) = explode('.', $x); $decimal = substr($decimal, 0, 6); if (empty($number)) { return (int) $decimal; } return (int) $number . $decimal; } echo removeDecimalAndToSixPlaces(52.71666666); //52716666 echo removeDecimalAndToSixPlaces(0.926888888); //926888 There's nothing particular complex within this, so you shouldn't have any performance problems runnning it 100,000 times. Although if this isn't something you plan on re-using, you should take it out of the function wrapper. sbustr couldn't be avoided as numer_format will round up the removed decimal points.
-
Generally just being able to read/write to one of those formats can be a complex task with PHP, never-mind reading from one and writing to the other. Most likely the reason you can't find anything on Google is because nobody has done it - or at least willing to release the code for free.
-
You were right with your second thought.
-
echo htmlentities($word);
-
I can't see the video at the moment as I'm at work connecting through a proxy, but when it comes to a website critique a video can look fantastic. Whether or not the website lives up to that in terms of mark-up, cross-browser compatibility, accessibility, etc. is another matter. If you want a proper critique, open up a private BETA site or something that we access.
-
onSubmit="return validateForm(newcat);" Here you're trying to pass a variable called "newcat" that doesn't exist. To pass a string you'd need to have quotes around it: onSubmit="return validateForm('newcat');" However it's easier to pass a special variable called "this", which represents the element's object, and use that within the function. So intead of calling document.newcat.category.selectedIndex for example, you'd use newcat.category.selectedIndex.
-
What data type are you using for the date column? You shouldn't need to use PHP to generate the date, MySQL has a built-in function called curdate() which will do that for you.. select * from table_name where date_column < curdate()
-
Floatbox and other javascript box functionality
Adam replied to brianlange's topic in Javascript Help
Never used it, but not keen on that floatbox. I prefer Facebox. -
First, what's the problem with it?
-
Assuming that SQL works as you want, try this: $sql = "SELECT INCIDENT_NO, SCHEME_CODE FROM incidents WHERE JOB_DATE_TIME LIKE '$searchDate' ORDER BY SCHEME_CODE, INCIDENT_NO ASC"; $query = mysql_query($sql) or trigger_error('MySQL Error: ' . mysql_error()); $prev_code = ''; while ($row = mysql_fetch_assoc($query)) { if ($prev_code != $row['SCHEME_CODE']) { $prev_code = $row['SCHEME_CODE']; echo '<br />' . $prev_code . '<br />'; } echo $row['INCIDENT_NO'] . '<br />'; } @unlishema.wolf It's double-equals. Also mysql_query only returns a result resource, you then have to loop through that using one of the fetch functions (e.g. mysql_fetch_assoc).
-
Oh.. So you are running the script from a local web server. Unless you have access to the server to execute FTP commands from it, then you'll need to use your local machine to get the files, before putting them to the other server.. unfortunately. You can use the temp directory as you say though, and just unlink them once you're done.
-
Well then on the server that the PHP script is executed, just ftp_put the files to the other server..? No need to go through your local computer.
-
I'm a little confused. Will you be running the script from your "local drive" with a web server installed? By server I assumed you meant you had an external web server you were running the script from.
-
You mean backslash, not "single slash"? Just looked back at your post and realized you were using a forward-slash.
-
Escaping the backslash will look for the literal "\n", not the newline character. It's possible the string has DOS/Windows carriage return characters ("\r") in it as well. Try this: $text = str_replace(array("\n", "\r"), '', $text);
-
Have you looked into the PHP FTP functions?
-
Trying to understand your logic here. Could you provide some sample data and expected results to make things a little easier?
-
You could just use PuTTY to access the server's VI(M?) editor (assuming it's Linux). That's real easy to transport, heck it's even available as an iPhone app now!
-
If he's only touched the basics of programming (in whatever language) how would ever know to type in 'process instantiation' or anything of the sort? It's not even so much what you say just way you blurt it out like you've changed his life or something.
-
dude il teach u everything u need to know about every language, when u need it, u go on teh internet and type in language name PROCESS instantiation, or language name Class definition or language name array manipulation thats it all the other bits are icing on the cake, oh and HTTP request What the ..? You're full of some right crap.
-
"The Pragmatic Programmer" by Andrew Hunt and David Thomas. Only about half way through at the moment but definitely recommend it to anyone.