Jump to content

roy0702

Members
  • Posts

    11
  • Joined

  • Last visited

About roy0702

  • Birthday 07/02/1990

Previous Fields

  • Languages
    PHP, Javascript with jQuery and Ajax, CSS

roy0702's Achievements

Newbie

Newbie (1/7)

3

Reputation

  1. Add styles for the livesearch div. Try absolute or relative.
  2. roy0702

    PHP browser close

    On your second code, you can use loops(for, while, do while) inside your condition for shorter code.For your question, Yes it will run but its not redundant unless you dont use any condition to stop your loop while manipulating the array.
  3. roy0702

    sessionID

    Oh sorry, change the $_SESSION to $_COOKIEor $GLOBALS.
  4. roy0702

    sessionID

    You can use this, it will display all session variables. With their value $query_string = "";if ($_SESSION) { $kv = array(); foreach ($_SESSION as $key => $value) { $kv[] = "$key=$value"; } $query_string = join("<br>", $kv);}else { $query_string = $_SERVER['QUERY_STRING'];}echo $query_string;echo "<br>";
  5. This is answered in your previous thread, kindly read it again. http://w3schools.invisionzone.com/index.php?showtopic=44984&view=findpost&p=250536
  6. Yes Birbal is right, use them to separate codes, inside or outside of a function or condition. If you are confused using too much braces you can learn the standard coding or you can use your own, just dont change your format. Or you can use some applications which will help you see the closing and opening braces and parenthesis. I used notepad++ months ago.
  7. Hmm lets see, you dont have any function, you have POST method that sends (I dont know how you did the form so you can paste here the code of your form) post variables. And it will still run the code after the if (isset ($_POST["juppp"])) ; if its inside the form of the submitted page. Because it will still submit the post and the post variable will be set so the condition is true.Next is you use the single line if condition. It will run only the things on the line itself knowing the condition of the line. example: if (isset ($_POST["juppp"])) echo $_POST["juppp"];it will run the code after the if inside the line itself and run all the codes after the line. So you have to use braces after the if statements.So I revised your code, take a look. I assume that your post inputs are both inside a form. And also checks is if the inputs have value. if (isset ($_POST["awwyeaa"]) && $_POST["awwyeaa"]!="") {for ( $i = 1 ; $i <= 10 ; $i++ ) {print $i." ";}print "<BR /><BR /><BR />";for ( $i ; $i <= 20 ; $i++ ) {print $i." ";}print "<BR /><BR /><BR />";for ( $i ; $i <= 30 ; $i++ ) {print $i." ";}print "<BR /><BR /><BR />";for ( $i ; $i <= 40 ; $i++ ) {print $i." ";}print "<BR /><BR /><BR />";}if (isset ($_POST["juppp"]) && $_POST["juppp"]!="") {echo "<table border=\"10\" align=\"left\">";print "<tr>";for ($i = 1 ; $i <= 10 ; $i++) {print "<td>$i</td>";}print "</tr>";print "<tr>";for ($i ; $i <= 20 ; $i++) {print "<td>$i</td>";}print "</tr>";print "<tr>";for ($i ; $i <= 30 ; $i++) {print "<td>$i</td>";}print "</tr>";print "<tr>";for ($i ; $i <= 40 ; $i++) {print "<td>$i</td>";}print "</tr>";} ___________________________________________________ On your second question, you dont have closing braces. use this: if (isset ($_POST["testplus"])){$testplus = $a + $b;echo " Als " . $a . " bij " . $b . " opgeteld wordt is de totale hoeveelheid " . $testplus ;exit;}
  8. No, you're not using any funtions in your code, the is_numeric function you use is a php built function, wherein you can use anytime without declaring and you dont need any parameters to use. Here is the function that w3schools is pertaining to: http://www.w3schools...p_functions.aspYou can't use any variables from the outside of your declared function if you dont insert them as a parameter (or parameters if you want many).But you can still use them without inserting, just by declaring it anywhere outside the function as a $global variable. Therefore, your variables up there need not to be declared as globals.
  9. You lack 1 closing parenthesis, here try this one...Edit: ok I saw some errors, just try this new one anyhow, I think the condition is wrong, because the first argument will be ignored if the 2nd is true, and vice versa, maybe you want to change the || condition to &&
  10. If I am not mistaken, you want every insects to have their own get variables for the get method using href. Well you can use arrays. first declare a variable outside the while with zero value:$x = 0; then increment it at the end of your while:$x++; then display each of your items from your query inside the while, before the "$x++", adding the $x to the end of your variables:$strLink = "<a href='descriptionpage.php?insect_des$x = ". $row['insect_com']. "'>".$strInsect."</a>"; the variable will then look like this if you retrieve it: $_GET['insect_des0'];$_GET['insect_des1'];$_GET['insect_des2'];and so on... then you can use the same way retrieving it, or you can look for your own way.
  11. Hello there, I experienced this so this might help you. Its an SQL error, when joining different tables with same columns, you should use "SELECT tableName.columnName, tableName2.columnName2, and so on".
×
×
  • Create New...