Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
There, I fixed it
-
-
http://www.phpfreaks.com/tutorial/php-add-text-to-image If you don't store it as an image, it'd be super easy for a bot to scrape it and thus make your field pointless.
-
Looking for a good tutor on making a messaging system
Philip replied to Shadowing's topic in Miscellaneous
Try searching for "private message php tutorial" -
It also very well could be that your provider is rate limiting you do to usage amounts (per day/week/month, etc.)
-
Looks like them pesky ads there ain't workin.
-
The Possible Variations of This Short Handle System?
Philip replied to Glese's topic in Miscellaneous
Given this is an English string with no non-traditional characters... 26 letters * 2 (for case sensitivity) 5 vowels (or 6 if you count 'y') * 2 (for case sensitivity) 26 letters * 2 (for case sensitivity) 5 vowels (or 6 if you count 'y') * 2 (for case sensitivity) 10 numbers possible 10 numbers possible 10 numbers possible Without completely giving the answer away, your max under 400 million. -
change email deactivates phpfreaks account
Philip replied to freelance84's topic in PHPFreaks.com Website Feedback
Hmm, that should probably be looked at. IMO it should be sending to the old email to confirm the new one. Sure, so let's say I'm a spammer and want to spam PHP Freaks with lots and lots of spam. Since we require email activation (I think...) on our accounts, I could follow this pattern: [*]Sign up with foobar@gmail.com - a valid email address [*]Activate the account [*]Switch the email address over to a fake one, foo@bar.com [*]Spam away [*]Repeat (using a proxy probably Now, since the forums typically don't keep a history of user's account changes made by themselves, we won't have the original email address and they can signup for another account to avoid bans based off of email addresses. However, with adding in the account lock + account change confirmation, it helps thwart spammers from using this tactic. -
change email deactivates phpfreaks account
Philip replied to freelance84's topic in PHPFreaks.com Website Feedback
I see it as it prevents unauthorized account changes (so long as the original email has to verify the new email) and helps prevent spamming by not allowing a user to signup with a real email address and then changing it to a dummy one so that they won't get banned off of the real email address when they spam -
You're using one
-
My favorite one: If you hadn't had sucked in the first place, this wouldn't be needed!
-
I guess I should clarify, you are indeed correct. For whatever reason I was thinking that if there was more to grab within the listimages table that would not work. But this is not the case (since we're grabbing one listing from the listings table) Example. if the table structure is as so: listings -------- id name -------- 1 test1 2 test2 3 test3 [...] listimages --------------------------------- listingid imagepath --------------------------------- 1 images/listings/1.jpg 1 images/listings/2.jpg 2 images/listings/3.jpg 2 images/listings/4.jpg 2 images/listings/5.jpg 3 images/listings/6.jpg ngreenwood6's method would be great. However, if it looked like: listimages ---------------------------------------------------- listingid imagepath imagedescription ---------------------------------------------------- 1 images/listings/1.jpg description 1 1 images/listings/2.jpg description 2 2 images/listings/3.jpg description 3 2 images/listings/4.jpg description 4 2 images/listings/5.jpg description 5 3 images/listings/6.jpg description 6 And at some point you wanted to grab "imagedescription" for each image when you're outputting the imagepaths, the solution would no longer be valid.
-
I'm no lawyer, nor do I really read the fine print (which I'd advise you to do), but typically it is allowed for a user to backup their files on X machines. But truthfully, as long as you don't allow anybody but yourself access to the music files, you should be just fine. Again, I'm no lawyer and my cannot be held responsible for my advice
-
Yup, this is also a method if you're just wanting to return what the comma delimited values of the images. If you're needing to use anything else within the row on a per-image basis, then this wouldn't work. You'd need to use a MySQL join for that and would want to list out the names of the columns (for performance and for clarity): SELECT l.id, l.name, li.imagepath FROM listing l JOIN listimages li ON l.id = li.listingid ORDER BY l.id DESC
-
Uhh, that's not what I'm getting (replaced your mysql with a static array): <?php $array = array( array('listingid' => 1, 'imagepath' => "images/listings/listing_848813453A-1.jpg"), array('listingid' => 1, 'imagepath' => "images/listings/listing_664613453A-2.jpg"), array('listingid' => 1, 'imagepath' => "images/listings/listing_520313453A-3.jpg"), array('listingid' => 2, 'imagepath' => "images/listings/listing_690513453A-4.jpg"), array('listingid' => 2, 'imagepath' => "images/listings/listing_125113453A-5.jpg"), array('listingid' => 2, 'imagepath' => "images/listings/listing_641013453A-6.jpg") ); $last_listingid = null; foreach($array as $row) { echo "\""; echo "$row[imagepath],"; echo "\""; if ($last_listingid != $row['listingid'] && $last_listingid !== null) { echo "<br />"; } $last_listingid = $row['listingid']; } Outputs: "images/listings/listing_848813453A-1.jpg,""images/listings/listing_664613453A-2.jpg,""images/listings/listing_520313453A-3.jpg,""images/listings/listing_690513453A-4.jpg," <br> "images/listings/listing_125113453A-5.jpg,""images/listings/listing_641013453A-6.jpg," In any case, you'll want to fix your comma/quote problem, so here is one solution: <?php $last_listingid = null; $curRow = array(); while($row = mysql_fetch_array($result)) { // Check for a difference in listing ID - and if it is, then we should show the previous row first if ($last_listingid != $row['listingid'] && $last_listingid !== null) { // Implode the array with quotes around it echo '"' . implode(',', $curRow) . '"<br />'; // And start fresh $curRow = array(); } // Now we can save it to the array $curRow[] = $row['imagepath']; // And set the new ID $last_listingid = $row['listingid']; } // Finally, we'll need to implode it one last time since there should always be at least one value in the array echo '"' . implode(',', $curRow) . '"'; ...which outputs... "images/listings/listing_848813453A-1.jpg,images/listings/listing_664613453A-2.jpg,images/listings/listing_520313453A-3.jpg" <br> "images/listings/listing_690513453A-4.jpg,images/listings/listing_125113453A-5.jpg,images/listings/listing_641013453A-6.jpg" <br> "images/listings/listing_641013453A-7.jpg"
-
A small change to the above code will prevent it from having a <br> on the first run. <?php $last_listingid = null; while($row = mysql_fetch_array($result)) { echo "\""; echo "$row[imagepath],"; echo "\""; if ($last_listingid != $row['listingid'] && $last_listingid !== null) { echo "<br />"; } $last_listingid = $row['listingid']; }
-
Welcome not mr ed
-
Feel free to slap that guy around a bit new user
-
<?php echo $hi; Welcome to phpfreaks
-
Welcome! Having fun in college yet?
-
We're all a little freaky
-
Check out this topic for books