-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
<?php phpinfo(); ?> That will tell you what version is running, put it in a file and run on both servers. Why do you run the exact same code on 2 pages?
-
What version of PHP is running on each server? What's the code for the "createThumbnail" function? Most likely you're trying to use some function on your remote hosting that is either disabled, or not available with that version of PHP.
-
What's in "conn.php"? You'll need to either re-write the fetch() function, or change it to a normal query: $check_ip = mysql_query("Select * from $tab[bannedip] where ip = '$userip'"); if (mysql_num_rows($check_ip) > 0) { echo "<html><body><script language=javascript1.1>alert('Your IP Address Was Banned!');</script><noscript>Your browser doesn't support JavaScript 1.1 or it's turned off in your browsers preferences.</noscript></body></html>"; exit; }
-
Yeah as jxrd was getting at fetch() isn't defined anywhere, so when you tried to call it in setup.php on line 77 it wasn't found and triggered the error there. Is this re-used code?
-
Your buffer is backwards...
-
That's not a question...
-
I have no idea...
-
It tells you the problem: 'Call to undefined function fetch()' ? Looks like a custom database function to query a database and return the rows. Are you sure the function is included into your code? It's not in any of the code you supplied, what's in "funcs.php"?
-
You wouldn't use the dot character in this case, you'd just say like 'any character except these': [^buias]+
-
if (!preg_match('/action=[^&]+/', $str, $matches)) { // no action } else { print_r($matches); } That will return something like "action=blah_blah". If you add in some brackets to the regex you can return the value of action as well, like this: /action=([^&]+)/
-
Have you tried dumping the data to see what's in there? var_dump($row4); Put that within the while loop and check there's actually data in there. If not it's likely the query's running successfully but not returning any results. You can check the number of records returned with: echo mysql_num_rows($query4);
-
... and the problem is?
-
$days_since = floor((time() - strtotime("04/04/2009"))/(60*60*24)); Just replace "04/04/2009" with the date you pull from the database.
-
Non-escaped data breaks input tag value attribute
Adam replied to grahamsimmons's topic in PHP Coding Help
Converting them to HTML entities should work: <input type="text" name="name" value="<?php echo htmlentities($name); ?>"> -
No, title values aren't passed through the form. You could create a hidden input and pass it through that way, or read the file contents into a variable and use regex to select the title.
-
Just do the smart thing and put... "You are using an outdated browser, upgrade to a much better one like Firefox or Chrome"
-
Most likely here: $arr[$row['error_text']] = $row['correct_id']; You'll want to replace the data stored within $row['correct_id'] before storing within your array - though I'm totally guessing as you've not supplied much information as to what you're trying to replace. However, as there's no braces {} after the while loop you can only run one statement, which depending how you've done the str_replace()'s may cause a problem. Change it to this to avoid any confusion: while($row = mysql_fetch_array($result)) { $arr[$row['error_text']] = $row['correct_id']; }
-
Yeah I agree, the text is definitely too plain compared to the background and border. I'd also make that border even width all the way round, looks a bit odd being wider on the sides. By the way the border also breaks in IE7! Border. I have no idea what the purpose of that GIF is but it drags the page down IMO. Glad to see the XHTML validated! The <center> tag is deprecated by the way... Not bad! I like orange...
-
Pardon me I see now. Replace this: [^.part] With this: (?!\.part)$
-
That doesn't make sense. But, the regex to match .part on the end of a string/filename would look like: if(!eregi("\.part$", $file)) It's possible there's syntax problems with that regex when used with eregi as I don't use it very much, I personally prefer using preg_match: if (!preg_match('/\.part$/', $file))
-
What were you searching for?? http://www.w3schools.com/media/media_browsersounds.asp
-
The default maximum file size for uploads is about 5MB; which is probably the reason why only some are failling. You are using the "MAX_FILE_SIZE" HTML attribute but this isn't always guaranteed to work. Take a look at this; has some suggestions on how to increase your max. file upload size.
-
Prevent a "Space" from being first characted typed in a text field
Adam replied to galvin's topic in Javascript Help
Or you could validate on the 'onblur' event. I'd probably just use one of the many custom trim functions/prototypes available online, something like this (found here): <script type="text/javascript"> String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } </script> <input type="text" name="..." onblur="this.value = this.value.trim();" /> You may wish to switch to the 'onkeyup' event if it needs to be validated after every character is input. There's load of other ways you could do it as well... -
You can do this easily with PEAR: <?php require_once 'Net/URL.php'; $dirtyurl = 'domain.com/index.php?PHPSESSID=12345&area=home'; $url = new Net_URL($dirtyurl); unset($url->querystring['PHPSESSID']); $cleanurl = $url->getURL(); ?> Although you may want to add "http://" to the start of your URLs to stop PEAR automatically adding the current domain you're on...