Jump to content

Gabslol

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

About Gabslol

  • Birthday 05/01/1987

Profile Information

  • Gender
    Male
  • Location
    Ga

Gabslol's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Going to tell the truth here and say I'm not exactly sure what you are trying to do. I will make a few comments on what I see though. You seem to be missing some brackets. Ex. <?php if ($review != 0) { $yes2 = "REVIEW"; echo $yes2; } if ($review != 1) echo ""; ?> I am only assuming this is how it is meant to function, as I don't know exactly what it is supposed to do. What the example reads to me is: If $review does not equal 0 then $yes2 equals "REVIEW", either way print $yes2. then continue with the next if statement.
  2. Hola, Found this site after doing a google search for php exercises. So I'm here to learn by helping figure out other peoples problems. Hope to learn a lot.
  3. Try using an if statement that checks if data has been sent, to be put into the data. if(isset($_POST['add'])) { //code that enters entry into the database } edit: That code makes sure the "add" submit button was pressed. Though, refreshing the page after adding a valid entry will produce duplicate entries. That is a whole 'nother problem, that I have yet to find the answer to though.
  4. Yes, give it a go and let us know. edit: I would actually put it inside the if statement, right after when value2 gets changed. That way, if the if() statement is not executed, it will not run the code again.
  5. Hello, I can't see exactly which lines in there are calculating the ratio, but did you recalculate it after changing the value in the if statement? Ex. If you sort() an array, then add more elements in the array, you will need to sort it again.
  6. Hmmm, looks like you'd need something else maybe browser-side that would flag a disconnect more so than a connection. Ex. Say a person visits your site, this does all the stuff that says "Hey someone is connected". If they leave the page, or close the browser, nothing is there to say "They left the site". In my limited understanding of php, it is server side, so whatever they do on their end, unless they click a logout button, your site won't know. Possibly something like Javascript would work better, or something from the server that could check a connection at an interval. Either way I'll be watching this post, in case a good idea does come up.
  7. Hello, I'm pretty new at this, so please correct me if I'm wrong but: <form id="form2" name="form2" action="settings1.php"> <table width="299" border="0" cellspacing="3" cellpadding="0"> Shouldn't this example from the first code snippet given contain; method="POST"? edit: changed action to method
  8. Mus, That code checks that there is actually data being passed by the form. In this case you'd want to do something along the lines of: <?php if(!isset($_POST) || empty($_POST) { echo '<br>Nothing was posted from form.<br>'; } else { foreach($_POST as $varname => $value) $_POST[$varname]=$value; ...All your other code here; } ?>
×
×
  • 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.