Jump to content

Channel6

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Channel6's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hahah. Maybe I should rephrase it then: Basically, I want to get an array() from a $_POST[].
  2. Channel6

    HELP!

    Hi, Anyone know the solution to this problem...? I have a row of radio buttons for a single variable, and I want to connect the radio button selection with the variable, then pass it through a form. I'm assuming I need to use an array, but I'm not exactly sure how to do that. Here's a snippet of my code: while($question = mysql_fetch_array($questions)){ echo ' <div id="row"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%">' .$question['text']. '</td> <td width="10%"><div align="center"> <input name="' .$question['id']. '" type="radio" value="1" /> </div></td> <td width="10%"><div align="center"> <input name="' .$question['id']. '" type="radio" value="2" /> </div></td> <td width="10%"><div align="center"> <input name="' .$question['id']. '" type="radio" value="3" /> </div></td> <td width="10%"><div align="center"> <input name="' .$question['id']. '" type="radio" value="4" /> </div></td> <td width="10%"><div align="center"> <input name="' .$question['id']. '" type="radio" value="5" /> </div></td> </tr> </table> </div> '; }
  3. Buddski, That's what I originally did. But it turned out that somehow some visitors had more than 1 IP address, so it counted double... even up to 4 times as many views than it should have. Any other suggestions?
  4. I've written a script where it counts the page impressions on my website. When a visitor lands on the page, it counts their impression and then sets a $_SESSION so that if they reload or return to the page it doesn't count it again. But the problem is it sometimes does. Does this mean that the $_SESSION isn't being set probably? That's what it seems to be. And if so, what would be the reason for that? Here's my basic code: if(isset($_SESSION['userid'])){ $userid = $_SESSION['userid']; } else{ $userid = rand(1000, 10000000); $_SESSION['userid'] = $userid; } $date = date('Y-m-d'); $counters = mysql_query("SELECT * FROM counters WHERE userid='$userid' AND impressions='1' AND date='$date'") or die(mysql_error()); if(!mysql_num_rows($counters)){ mysql_query("INSERT INTO counters (userid, impressions, date) VALUES('$userid', '1', current_date)") or die(mysql_error()); }
×
×
  • 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.