Jump to content

kevinak

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kevinak's Achievements

Member

Member (2/5)

0

Reputation

  1. What if there is a large number of members. So like over time 100 announcements x 2000 members = 200,000 rows in the table.. does that matter?
  2. I am attempting to make a bulletin board on my site where I can add information and display them almost like posts in the forum. When the page is opened, there will be a list of all the announcements. I would like unread announcements to be marked as such for each individual user. Maybe just highlighted a different color, whatever, not the point. My question is how would I go about knowing which announcements are read or unread for each user? Like say in my database, I have announcement one with a timestamp, how can I make that show as read and unread to different users, while still having other announcements? Yes, I do have phpbb3 installed on my site.. And you are probably like WHAT?, why would you want to do this if you can just have an announcement cat? Well, I'm crazy, stupid, and love to do my own things.
  3. Ok, I have a simple donation button on my site. When a success donation has occured, it transfers you to a thank you page, where it will add information to my database. How can I prevent a user from refreshing and adding more to the database without setting an actual limit to how many times they can donate? Is there a special ID system I can use so that they can only access the page once after they donate? Also, how can I pull the donation amount from paypal and put it into a php variable?
  4. How would I go about passing a single var from flash to php? Let's say I had var score in the game and it was 25. Is there anyway to get that 25 and save it into a php var?
  5. Hello. I have a query that checks for pet IDs based off a user's id. It generates a table with all the ones that it finds with this code //checks if any results are returned if (mysql_num_rows($resultpets) > 0) { //sets up my table echo"<table border=1 width=500>"; //For each pet id found, it will add a column while($row = mysql_fetch_row($resultpets)) { echo "<tr><td><center><img src=http://whimpsters.net/pets.php/".$row[0]." style='border-style: none'><input type=checkbox name=".$petname[$row]." value=".$row[0]." /></td>"; //4 more columns to make 5 column rows The key point to this being... <input type=checkbox name=".$petname[$row]." value=".$row[0]." /> Now I have the checkbox's name to equal the array $petname[petid] and the value is just the pet id number. Now, using a for each loop, how can I check which check boxes have been marked? Would it be anything like this foreach($petname as $key => $value) { if(isset($key)) { //do stuff for checked boxes } }
  6. I seem to me having some trouble with this crazy amazing thing. I have the file in my root directory name .htaccess in that file the only code I have is RewriteEngine ON RewriteBase / RewriteRule ^home/([^/\.]+)/?$ home.php?id=$1 Now shouldn't that reroute my page www.example.net/home/1 to www.example.net/home.php?id=1 ? Is there a tag I need to place in the .htaccess file?
  7. I'm going to agree with this, seriously. But do you have a link to a place with a good mod_rewrite tutorial?
  8. Ok, I had this brilliant idea a little while back. But I have a bad feeling that using mod_rewrite is a lot safer. function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } $whatever_ID = curPageURL(); $whatever_ID2 = explode('/',$whatever_ID); Basically you store the url into an array with that function. Then you simply explode that array and pull the data from it.
  9. It used to be only like 2 a day, but the morning lag was for like 6-7 hours. Now the morning lag is more random and it goes down 9-13 times a day. :/ Hard to keep track of because they are sometimes very quick
  10. I may not be the best php programmer out there. I'm quite the novice, but i've been noticing that my site will randomly go down for like 5 minutes and sometimes it will get really bad lag in the mornings, but then run really smooth for the rest of the day. Could this be caused by poor php coding? I also have a phpbb3 forum on the same domain that displays the same behavior at the same times. I've contacted my host. And they say it's fine, but if I want I can change servers but I wouldn't be allowed to touch my files for 1-3 days.. Well. I'm Not advertising, but if someone would just take a peek at my site and notice the amounts of lag and such and tell me their opinion on it, that would be great. http://www.whimpsters.net http://www.whimpsters.net/forum
  11. Ok this code generates images and checkboxes in a table for my site while($row = mysql_fetch_row($resultpets)) { echo "<tr><td><input type=checkbox name=petID".$row[0]."><img src=http://whimpsters.net/pets.php/".$row[0]."></td>"; Now, I need to somehow to check if one of the checkboxes are checked and if they are, I need to be able to use their ID number which is the same as $row[0]. But also relize that that number would have to be grabbed before it moves to the next image. Is there anyway to get it from the checkbox name or value? I've been trying to created an array and use the foreach function, but it always fails. I'm at a loss. Anyone? Thanks for reading
  12. well can I just set the value of the each checkbox generated to row[0] or the pet ID number? Then extract that with a for each loop? Or how can I just check them all and pull out the ID's that are checked? That's what I'm really trying to do here.
  13. Wait aren't I setting it to..? <?php echo '<tr><td><input type="checkbox" name=".$petID['$row[0]']."><img src="http://whimpsters.net/pets.php/'.$row[0].'"></td>'; ?> And so let's say we have $petID[4] and it's checked. Would $petID[4] = true?
  14. Ok well I have a script that is going to generate a table with images and checkboxes in each cell. Got everything to generate properly and such. But I need a way to 1. Check if one of these boxes are checked 2. If checked I need to get the ID out of them. Here's a bit of my code. //Here search $pets = "SELECT Pet_ID FROM pets WHERE user_id = $userid"; $resultpets = mysql_query($pets) or die ("Error in query: $query. ".mysql_error()); //do while loop while($row = mysql_fetch_row($resultpets)) { //This generates the cell with image and checkbox echo "<tr><td><input type=checkbox name=".$row[0]."><img src=http://whimpsters.net/pets.php/".$row[0]."></td>"; //here is where my problem is.. I don't know how to store the pet id and isset into one array. $tradeID[$row[0]] = isset($_POST["$row[0]"]); More on that. //this is basically all I want to be able to do foreach( $tradeID as $key => $value){ //need to grab the Pet_ID somehow and check if it is checked } Problem is that I get "Invalid argument supplied for foreach()" returned I don't know how confusing that was. But let me know if you have any ideas Thank you for reading.
  15. You guys are the best seriously Very fast and super knowledgeable. Thank you so much. I'm going to put these up right away Oh and if any of you see this. How would I then destory the session? Do I use the session_destroy() function?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.