Jump to content

flolam

Members
  • Posts

    96
  • Joined

  • Last visited

    Never

Everything posted by flolam

  1. the array_map should be array_map(array("className", "prepSessions"), $this->sessions)) where, of course, className is to be replaced with whatever classname you have
  2. Yes, you would have to submit the form using ajax. Googleing "ajax submit form" I found http://www.simonerodriguez.com/ajax-form-submit-example/ , but I'm sure you will find loads of other tutorials.
  3. take a look at autoloading: http://php.net/manual/de/language.oop5.autoload.php
  4. if you use variables in double-quoted strings, the PHP interpreter replaces them with their values. Thus, you will have to use single-quotes: $stringData = '$newcolumn = $info[\'newcolumn\']';
  5. remove the appended number from the field names (so for example "Item1", "Item2" etc. becomes simply "Item") and then $total4 = $_Post["Total4"]; $client_details = $_Post["Client_Details"]; unset($_Post["Client_Details"]); unset($_Post["Total4"]); foreach ($_Post as $inputgroup) { echo $inputgroup["Item"]; echo $inputgroup["Price"]; //... }
  6. you don't need a foreach. just remove this line: $age = mysql_fetch_assoc($getinfo); and change the while statement to this: while ($age = mysql_fetch_assoc($getinfo)) {
  7. you could make your links point to <a href="/index.php?site=index"></a> <a href="/index.php?site=mkvsdc"></a> ... etc. and then change the include to <?php if (!$_GET["site"]) { //in the case that no site was specified, include index.html include "index.html"; } else { include $_GET["site"].".html"; } ?> Also, include should be used without brackets
  8. flolam

    Linking

    funny question, of course it is allowed
  9. does your button image file have a .jpg (and not jpeg, gif, png etc) file extension?
  10. your onchange event doesn't send any data back to the server, where the php file is. It only changes the location at the client-side. You will either have to use ajax or use normal links
  11. google -> "directory index hide file" -> first result -> http://www.hackersdiary.com/how-to-hide-files-from-apaches-directory-index/ IndexIgnore .htaccess IndexIgnore *.jpg
  12. of course, this will always work: $a = "31"; if ($a == "29" || $a == "30" || $a == "31" || $a == "32") { echo "true"; } --edit-- or: $a = "31"; $b = array("31", "32"); if (in_array($a, $b)) { echo "true"; }
  13. this does work on my machine: $a = "31"; if ($a == "29" || "30" || "31" || "32") { echo "true"; } //output: true --Edit-- I just noticed that this will always return true, no matter what value $a has
  14. what is the problem with the code you have? if you want to check whether the string contains this number, you will have to use a function like strstr (http://php.net/manual/en/function.strstr.php), because currently you are checking whether the variable has exactly this value
  15. look at my post: you need to insert mysql_fetch_assoc AFTER you do mysql_query
  16. before you can use $row["column"] you have to use mysql_fetch_assoc(result of mysql_query), which will give you an array of your result. You are already doing this in the while loop you use to display the link, but not for the form. Thus, you should insert $row_to_update = mysql_fetch_assoc($sql); after this $sql = mysql_query("SELECT * FROM news WHERE news_id='$id'") or die(mysql_error()); and then fill the form like this echo $row_to_update[column_name];
  17. Sorry, my code contains a mistake, it should be echo $output; of course
  18. You don't need to make two files, simply make the action attribute point to its own file, i. e. in test.php: <form action="test.php" method="post"> Additionally, if you only want to check whether the form was submitted, it's better to use if($_SERVER['REQUEST_METHOD'] == "POST") {} (see http://www.vbforums.com/showthread.php?t=562749 )
  19. You should tell the form what to do: <form action="" method="post">
  20. you are not using quotes around your html attribute values and the dots don't belong there echo "<input type='text' name='t[$j][$i]' />";
  21. //this echo $f6?aid=$f8; //should be this echo $f6."?aid=".$f8;
  22. This will make the option from the db preselected: <select> <?php $countries = array("Antarctica", "Australia", "England"); foreach ($countries as $c) { $output = '<option value="'.$c.'"'; if ($c == $country) { //$country is the one from the database $output .= ' selected="selected"'; } $output .= " >{$c}</option>"; echo $ouput; } ?> </select>
  23. there is no <form> tag around your input
  24. you should name your input boxes like this: and your $_POST["t"] will be a multidimensional array (use print_r($_POST["t"]) to see what it looks like) which you can iterate over and use to insert into the db
  25. what is the problem with this code?
×
×
  • 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.