-
Posts
1,041 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
username as comment message author - Help Me Please
gw1500se replied to Jordanxl's topic in PHP Coding Help
Perhaps I do not understand what you want but why does using $_SESSION['user_id'] not work? -
parse-error with a 4 liner : unexpected syntax
gw1500se replied to dil_bert's topic in PHP Coding Help
It seems pretty obvious to me. In 2 places you have 'text]'. -
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++]' />" ;
-
I don't think that would cause a syntax error. We need to see the preceding code.
-
You are getting that error because the syntax of something previous is wrong.
-
Combobox show information selected from database
gw1500se replied to ciresuark's topic in PHP Coding Help
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. -
Combobox show information selected from database
gw1500se replied to ciresuark's topic in PHP Coding Help
Did you look at the resulting page source to check for any HTML errors? -
Clean URL????
-
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.
-
Fix the link rather than try to translate it. It still makes no sense to me.
-
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?
-
A non well formed numeric value encountered ..error
gw1500se replied to bidawinner's topic in PHP Coding Help
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'. -
https://www.php.net/manual/en/function.htmlentities.php
-
A non well formed numeric value encountered ..error
gw1500se replied to bidawinner's topic in PHP Coding Help
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. -
$_SESSION value not being erased even after logout.
gw1500se replied to Robinson's topic in PHP Coding Help
Then you need to move the include to the beginning of the file. -
Sorry, I didn't realize you meant '<' literally. You need to use htmlspecialchars for that. if (isset($_POST['process'])) { print(htmlspecialchars($_POST['data'])); }
-
It works for me. Array ( [data] => test [process] => Submit Query )
-
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>"; }
-
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.
-
Total output of mysql sum query from different columns
gw1500se replied to a topic in PHP Coding Help
Search engines are your friend. https://www.php.net/manual/en/function.array-sum.php -
What is 'MySQLi_query'? Did you write your own function? PHP is case sensitive. I am guessing you meant 'mysqli_query'.
-
$_SESSION value not being erased even after logout.
gw1500se replied to Robinson's topic in PHP Coding Help
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. -
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);