Jump to content

gw1500se

Members
  • Posts

    1,041
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. Perhaps I do not understand what you want but why does using $_SESSION['user_id'] not work?
  2. So what did you try and what did you get that you did not expect?
  3. It seems pretty obvious to me. In 2 places you have 'text]'.
  4. Don't give the same name to every button. Create an array of buttons then check which one was selected when you process the submit. i=0; while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["comment"]. "<br>"; echo "<input type='submit' name='button[i++]' />" ;
  5. I don't think that would cause a syntax error. We need to see the preceding code.
  6. You are getting that error because the syntax of something previous is wrong.
  7. If you looked for an error you won't find it. I meant look at the generated HTML source and see if the structure and data for the option box is there and correct. If it is not, you should be able to see what was built and what is missing/wrong.
  8. Did you look at the resulting page source to check for any HTML errors?
  9. Clean URL????
  10. You need to explain what you are trying to accomplish. I can not imagine why you want to do this with .htaccess. Perhaps we can suggest a better way.
  11. Fix the link rather than try to translate it. It still makes no sense to me.
  12. Since those are arguments for the request, I don't understand why you would want to do that. Please explain what you are trying to accomplish. A URL that looks like http://localhost//Active=View/PostCategory=1 makes no sense. If you rewrite it that way with .htaccess, what/how do you expect it to be processed?
  13. If that is the output from the echo then it is obvious you cannot multiply that string by anything. It is not numeric just as the error says. I am again just guessing but I think you want: distance($service->distance * 0.6) I don't know how you change the string 'miles' to 'kilometers'.
  14. https://www.php.net/manual/en/function.htmlentities.php
  15. Without knowing what 'distance' does or '$server->distance' contains I can only guess. echo distance($service->distance); You will likely find that the result is not numeric.
  16. Then you need to move the include to the beginning of the file.
  17. Sorry, I didn't realize you meant '<' literally. You need to use htmlspecialchars for that. if (isset($_POST['process'])) { print(htmlspecialchars($_POST['data'])); }
  18. It works for me. Array ( [data] => test [process] => Submit Query )
  19. The first time the page is displayed I would expect it to be blank since nothing has been entered yet. Normally that print should only be executed AFTER the submit. if (isset($_POST['process'])) { echo "<pre>"; print_r($_POST); echo "</pre>"; }
  20. It is consider best practice to either leave the action parameter out or if you use it to specify a filename. As an aside, I don't think I've ever seen the method in lower case, it is always POST or GET. Perhaps someone can confirm if that is case sensitive. Also please use the code icon (<>) for your code and select HTML or PHP.
  21. Search engines are your friend. https://www.php.net/manual/en/function.array-sum.php
  22. Sure. Read the manual.
  23. What is 'MySQLi_query'? Did you write your own function? PHP is case sensitive. I am guessing you meant 'mysqli_query'.
  24. File_1.php has no session_start. File_2.php does not have session_start at the beginning. You need to take it out of 'inc_fn_header_and_menu.php' and put it at the beginning of file_2.php.
  25. First never, ever put web page data directly into a database. Always use prepared statements. Second, you didn't post the code where you are executing the query. Third make sure error reporting is turned on: error_reporting(E_ALL);
×
×
  • 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.