-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Does any of your code depend upon sessions, or cookies?
-
You need to implement a check similar to: $valid_mimes = array( 'image/png', 'image/gif', 'image/jpeg', // etc.. ); if (!in_array($_FILES['photo']['type'], $valid_mimes)) { // handle error here }
-
What's the format you're using there? Little unusual (and logically flawed) to have the date before the month. Anyway best solution looks like: http://stackoverflow.com/questions/3075577/convert-mysql-datetime-stamp-into-javascripts-date-format You'll need to swap the parameters round for your month and date though.
-
Populating an modal popup with info from textfields on same page
Adam replied to Solarpitch's topic in Javascript Help
Can you show the layout of your form and how you're calling Facebox? -
I'd go with a different AJAX handler though, no offence iainwood.
-
Help writing to file after specific keyword in file
Adam replied to djones's topic in PHP Coding Help
Forgive for asking the obvious, but you can't you just manually add these? You may also run into problems with write permissions; it's not likely PHP will have access by default. -
Given the situation why not spend your time on integrating the user tables, as opposed to a work-around for the problem?
-
I need help passing array variables/ singling out user data
Adam replied to dj262501's topic in PHP Coding Help
Should be: $duration = $_POST["duration['".$row['Name']."']"]; -
Ha! What..? As it happens last week I took my 14inch girthy beast and noshed 32 bitches, in a day!
-
Do you have an example of the data and desired XML output?
-
You mean an English speaking country? I'm from England and speak English pretty well.
-
The browser automatically passes every input whether or not it's empty. Trying to use JavaScript to create a work-around is a bad idea, as not everybody has JS enabled. That and it's much more hassle than it's worth, why not just check if the user entered anything with the PHP empty function?
-
Yeah, termidave's right. On msdn there's a list of tags that it applies to: http://msdn.microsoft.com/en-us/library/ms536439%28VS.85%29.aspx
-
How can i get this to load faster?? using jquery
Adam replied to geekisthenewsexy's topic in Javascript Help
Try checking the HTTP headers with the FF add-on Live HTTP Headers. That may give a clue as to why it's not working.. -
Yeah that's perfectly fine, it won't make any difference with speed. All it is a path so that the browser knows where to go. I'm not sure what mraza's suggesting with using the server's document root, but $_SERVER['DOCUMENT_ROOT'] (which ever way it's accessed) is the server's file system path to the document root, not the browser's / publically accessible path.
-
What's the problem with it?
-
textarea scroll "jump to start" when insert smiley
Adam replied to eevan79's topic in Javascript Help
In answer to your first question, just send the smiley as the second parameter to formatText(). I don't have time to look into your IE problem at minute though, I'm just about to leave. I'll take a look later on. -
If you don't specify a path for the links, they'll default to the same directory. You need to specify either the relative path from the current directory: href="../entry.php" Relative from the document root: href="/myPage/entry.php" Or an absolute URL: href="http://localhost/myPage/entry.php"
-
textarea scroll "jump to start" when insert smiley
Adam replied to eevan79's topic in Javascript Help
Basically you have to capture the scrollTop value of the text area before you change the value, then reapply once it's been changed. You'll also need to set the new selection after, otherwise the cursor won't be in the right position: function formatText(el, tagstart, tagend) { if (el.setSelectionRange) { var start = el.value.substring(0, el.selectionStart); var selected = el.value.substring(el.selectionStart, el.selectionEnd); var end = el.value.substring(el.selectionEnd, el.value.length); var scroll = el.scrollTop; var caret = el.selectionStart; el.value = start + tagstart + selected + tagend + end; el.focus(); el.scrollTop = scroll; if (selected.length == 0) { el.setSelectionRange(caret + tagstart.length, caret + tagstart.length); } else { el.setSelectionRange(caret, caret + tagstart.length + selected.length + tagend.length); } } else if (el.createTextRange) { // IE code here... } } That'll cater for when you pass a start and end tag for highlighted text too. I'll let you have a bash at the IE compatibility part though, look into createTextRange -
A script to check files in one directory and copy them to annother...
Adam replied to Curver's topic in PHP Coding Help
Could you not just set-up the 'https' dir as a symlink to 'http'? -
Create a plain text file with your cron job in. For example: 0 0 * * 1 command to be executed You'll then need to use the crontab program to install the cronjob: crontab /path/to/cronjob/file You can then check the cronjob was installed successfully with: crontab -l
-
Try 'onkeyup'.
-
Oh yeah, now I've reread it can see what you mean. Have to see what the OP says..