Jump to content

username01

Members
  • Posts

    18
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

username01's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need to write data from checked checkboxes into a database table for specific user, which is currently logged in. And after that, when the user enters the same page next time, look up the database and make the checkboxes he checked appear as checked. My current code contains not much for the checkboxes, as I have no idea how to do it: if($session->logged_in){ echo "<div align='center' id='wrap'><form action='process.php' method='post'><fieldset>"; echo "<legend>Choices</legend>"; echo "<p><input class='input' type='checkbox' title='Select anything you want' name='one' id='one' value='a'><label for='one'> Selection #1</label></p>"; // Contains ~10 of these, of course different names. echo "<input type='hidden' name='subprivilegies' value='1'/><br>"; echo "<input type='submit' value='Submit'/>"; echo "</fieldset></form></div>"; It's basically only html code for the checkboxes...
  2. That's for saving the checkboxes if the user goes somewhere out of the site, not to insert them into the database. I'm a newbie and not able to make a SQL code from that code yet, I need something more specific. Thanks.
  3. Hi. I want to put data from these checkboxes (example): Jan (value = jan) Chris (value = chris) Tom (value = 50) Jon (unchecked) Put janchris50 to the database after finding correct row with user ID, which is user_id for this example. Then, the user goes to another page and he should see this: Jan (checked) Chris (checked) Tom (checked) Jon (unchecked) In other words - page should get the information from the database and check the checkboxes that appears to be checked in the database. By the way, it should rewrite the row each time, as the user can modify it. Thanks.
  4. It doesn't load the page at all. It's a blank page either way, so I can't tell you that. :/
  5. Thanks, but it didn't worked still: while($row = mysql_fetch_row($query)) { if $row[3] == '0' {$row[3] = $value_text} echo "<tr>"; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; echo '<td>' . $row[3] . '</td>'; echo '<td>' . $row[4] . '</td>'; echo "</tr>\n"; }
  6. while($row = mysql_fetch_row($query)) { if $row == '0' {$row = $text_specified} echo "<tr>"; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; echo '<td>' . $row[3] . '</td>'; echo '<td>' . $row[4] . '</td>'; echo "</tr>\n"; } My equation syntax is correct, but code is wrong.
  7. while($row = mysql_fetch_row($query)) { echo "<tr>"; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . $row[2] . '</td>'; echo '<td>' . $row[3] . '</td>'; echo '<td>' . $row[4] . '</td>'; echo "</tr>\n"; } Currently I have this code. I would like to make it print certain text, let's say... 'car', if the value of table's column 'automobiles' is equal to 0. Otherwise - print the real value. I've tried if statement and $one = $two... But that apparently didn't worked. Thanks.
  8. Hm, there won't be many users. I will be able to manually clean the database occasionally. There may be... Few users a month. It's a small community.
  9. No, I don't. I have a control, what to send to the site... Hmm. I could ask to do it another way, but then it would a little different. I could send some data to the 'unrelated' site, and send the data from the checkboxes to the database. Then, when the site will send the user to my chosen site... It could be, that it would do some different thing. Hm. Maybe, if someone could say, that he/she could do it, could send me a PM, and I could give the details, why and what exactly would be the use of it. Or, maybe I could PM you, Pikachu, and ask for advice, what would be the reliable way to do it? I don't want to post the exact use of this system I thought of in public.
  10. The unrelated site sends him back to my site, when he clicks a button.
×
×
  • 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.