-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
You're missing a bracket, should be: if(!is_numeric($_GET['id'])){
-
What code do you have so far?
-
What's this doing? $row_current_site['url']; Edit: Scratch that idea! Obviously the problem lies with: $ftp_fp = fopen("ftp://".$ftp_username.":".$ftp_password."@sjwright.co.uk/domains/edit.sjwright.co.uk/html/".$ftp_file,"w"); Have you tried echo'in out that string on it's own?
-
Edit: Bjom beat me too it. The literature you've read is probably out of date now.
-
No. mysql_real_escape_string() only escapes quotes and a few other characters whilst entered into the database, so that MySQL basically knows it's not a break in the string. MySQL removes them. Consider.. MySQL would think the string ends after dangerous. The backslash is used to tell MySQL, or what ever the situation (PHP strings, regex, etc.) to use the literal meaning of the character. Also when you see two or more backslashes that means to use the literal meaning of the backslash.
-
Yeah but can sort that easily with... sort($numberArray);
-
Have a read through this.. http://www.phpfreaks.com/tutorial/php-security
-
At first glance I'd guess this is your problem: $_POST['\"rec_type\"'] Should be: $_POST['rec_type']
-
Read the link I sent you, should have an idea then! I can't tell you where to put it now though cause I have no idea what your code is like...
-
Pretty nice, very artistic. Can't give much more feedback at the moment as it's just an image, I think half the talent with a design like that is converting it to mark-up. I do wonder though how another page would look?
-
Try using htmlspecialchars as you output the data, if no success you may need to convert using htmlspecialchars() as you *input* the data.
-
MySql Free Result Error: Something wrong with the code...
Adam replied to Huijari's topic in PHP Coding Help
You're placing them out of the IF block in which the 'result resources' are created. This means that unless 'count($relist) > 0' (line 43) they're trying to free the result memory of a resource that doesn't exist. Move them within the if block. As it says in the manual for mysql_free_result, you only really need to use this if you're 'concerned about how much memory is being used'. In the updates: $result2 = mysql_query("update webid_auctions set starts = '$a_start' where id = $lot[$i]", $conn); $result1 = mysql_query("update webid_auctions set ends = '$a_end' where id = $lot[$i]" , $conn); $result3 = mysql_query("update webid_auctions set closed = '0' where id = $lot[$i]", $conn); $result4 = mysql_query("update webid_auctions set relisted = '$n_relist' where id = $lot[$i]" , $conn); Roughly how many records are updated? -
I'd suggest just starting your own little project, a lot of people tend to choose a forum or min-social networking site as a starter. It'll more than likely not go anywhere, but it's a good learning experience.
-
How to fetch only data from within certain html tags?
Adam replied to spaze's topic in PHP Coding Help
Firstly I should point out that using an ID twice isn't valid (X)HTML. However to do this you'd use regex. Give this a try: if (preg_match_all('#<p id="myparagraph">(.*?)</p>#s', $source, $matches)) { print_r($matches); } The content you're interested in would be found in the $matches[1] array. As I was saying at first though, I'd change the attribute to "class"; not "id". -
I don't know a great deal about the approval process of Google adsense, but unless you have a lot of traffic I'd personally wait a few months till your site's been around a while and they're more likely to give it you. I can't see you earning $50 off adsense any time soon...
-
Actually I agree with Centanu, the stats along the bottom aren't in-line which makes it hard to spot the information you're looking for, and with it being so compressed makes it look cluttered.
-
MySql Free Result Error: Something wrong with the code...
Adam replied to Huijari's topic in PHP Coding Help
Sorry from your code I missed part of it out, the block that would replace is: $numlot = mysql_num_rows($result); for ($i = 0; $i < $numlot; $i++) { // SAVE THEM IN ARRAY $lot[$i] = mysql_result ($result, $i, "id"); $title[$i] = mysql_result ($result, $i, "title"); $duree[$i] = mysql_result ($result, $i, "duration"); $B_Now[$i] = mysql_result ($result, $i, "buy_now"); $prix[$i] = mysql_result ($result, $i, "minimum_bid"); } -
MySql Free Result Error: Something wrong with the code...
Adam replied to Huijari's topic in PHP Coding Help
Okay, so consider this: $lot[$i] = mysql_result ($result, $i, "id"); $title[$i] = mysql_result ($result, $i, "title"); $duree[$i] = mysql_result ($result, $i, "duration"); $B_Now[$i] = mysql_result ($result, $i, "buy_now"); $prix[$i] = mysql_result ($result, $i, "minimum_bid"); It would be changed to this: while ($row = mysql_fetch_assoc($result)) { $lot[] = $row['id']; $title[] = $row['title']; $duree[] = $row['duration']; $B_Now[] = $row['buy_now']; $prix[] = $row['minimum_bid']; } -
Could you post the code exactly as you have it while it's generating that error.
-
Oh, would seem you can!
-
To add to that, although it may be a slightly better match, I highly doubt there's ever a situation where that small difference would win you a hit over someone else.
-
The problem is with: '$_SESSION[`currentgig`]' Indexes must have single or double quotes around them, not the 'grave accent'. There's a few variations you could change this to, for example: '".$_SESSION['currentgig']."' There's another occurrence of this a few lines down by the way. Edit: Deansatch beat me too it! Edited again: Didn't realise at first the value was for a table name, should be: `".$_SESSION['currentgig']."` I may be wrong but I don't think you can create tables with spaces?
-
Take a look at this... http://www.phpfreaks.com/forums/index.php/topic,220659.0.html
-
Show us your code... If the value's contained within quotes it shouldn't matter if it there's spaces.
-
No the link identifier is optional, however if one isn't specified it tries to use the last open connection. For some reason it may not be able to and throwing an error. Try moving your connection code before you use mysql_real_escape_string().