bsmither
Members-
Posts
213 -
Joined
-
Last visited
-
Days Won
3
Everything posted by bsmither
-
Forgot Password script - What am I doing wrong, help please :(
bsmither replied to tristan5522's topic in PHP Coding Help
A few points with this: $sql_update = "update ".TABLE_user." set 'password' = '".md5($password)."' where 'user_email' = '$email_address'"; PHP is treating TABLE_user as a constant -- it is not inside quotes, so it is not literally a string, and it does not have a $ in front, so it is not a variable, and it does not have parentheses after it, so it is not a function. Where is this defined? SQL statements should have backticks surrounding table and column names -- not apostrophes. The backtick is on the key above the tab key on the keyboard. -
::::---- Problem with login php mysql script ----::::
bsmither replied to MachineGamer's topic in PHP Coding Help
Please try this (the code you posted above must have had some edits, as line 16 is a blank line): $sql = mysql_query("SELECT mail_enseignant,Nom_Enseignant,Mot_de_passe FROM enseignant WHERE email='".$email."' AND password='".$password."' LIMIT 1"); if (!is_resource($sql)) die("Query Failed. ".mysql_error($sql)); if(mysql_num_rows($sql) == 1){ -
::::---- Problem with login php mysql script ----::::
bsmither replied to MachineGamer's topic in PHP Coding Help
According to the code above, line 75 is the HTML tag <fieldset>. -
::::---- Problem with login php mysql script ----::::
bsmither replied to MachineGamer's topic in PHP Coding Help
One error I found is: <?phpif (isset($login_error) ... Allow me to suggest keeping the script start delimiter separated from code: <?php if (isset($login_error) ... -
Your local pub?
-
Can we try this with these edits? Was: <script src="../includes/contact.js" type="text/javascript" charset="utf-8"></script> <html> <body> Now: <script src="../includes/contact.js" type="text/javascript" charset="utf-8"></script> </head> <body> Was: </body> <?php include( '../includes/footer.php'); ?> </html> Now: <?php include( '../includes/footer.php'); ?> </body> </html> Not making any promises.
- 3 replies
-
- javascript
- form
-
(and 1 more)
Tagged with:
-
Here is your argument list: put($name, $value, $expiry) And this is your call: put($name, ',' time() - 1) Methinks the second argument, for $value, perhaps being an empty string, has the comma in the wrong place.
-
Good start. Let's look at a few things: For every iteration of the while loop (mysql_fetch_assoc), you are creating a form and a table. By creating x-number of forms, each with it's own distinct inputs, you will only be able to Submit one form at a time - that is, one record at a time. Your task is to be able to update many records at a time. Take the <form> and <table> outside the loop, leaving just the <tr> and <td> inside. Also, move the Submit input outside the table structure but still inside the form block. Look again at the names of the form's input elements. Only those names will appear in the POST array. So, the statement $name = $_POST['name']; is causing one error. Please determine if, at this point, you need $name for anything. Again, look carefully at the names of the form's input elements. Hand-write what you think the final HTML will be for the input's name attribute. We have created an array of inputs, so the POSTed result will also be an array. If it helps, have your browser show you the source HTML it received. (You will need to discover how you would get the browser you are using to show the source.)
-
A couple of points: $sessionID is not evaluated/expanded inside single quotes. Try: AND a.name="' . $sessionID . '"'; a.name is expecting a string containing a name. So the user's name must be captured somewhere and assigned to $sessionID. Make sure $sessionID is an actual session variable. It looks like a standard variable right now.
-
"I want to be able to edit multiple price fields and then submit the update back to the tables." This implies you need a form. Within the form, you use input elements. The inputs will be text type elements with the existing value coming from $row_sql["price"] The element name must also contain a reference as to which row from the table the price came from. So, perhaps use name="product_price['.$row_sql["id_product"].']" There is a redundancy because the query may be returning both: ps_product.id_product and ps_product_lang.id_product. (I don't know if that is true.) They are the same value so you don't need both in the list of columns in the query. Remove ps_product_lang.id_product. It can still be used elsewhere in the query. Let us know when you have coded the form.
-
I do not expect any results -- not until all the code that uses $p (or it's matched parameter in called functions, such as $activePage) is tested against the phrase 'all' and dealt with appropriately, instead of assuming the value will only be like an integer.
-
Two things: Where is $p = $_GET['p']? I would try: Was: if ($activePage < ($numPages-1)) {echo("<li style=\"border:none; font-size:18px; margin-top:-6px;\"><a href=\"$url&p=" . $numPages . "\" class=\"paginationArrows\">»</a></li>"); } echo("</ul></div>"); Now: if ($activePage < ($numPages-1)) {echo("<li style=\"border:none; font-size:18px; margin-top:-6px;\"><a href=\"$url&p=" . $numPages . "\" class=\"paginationArrows\">»</a></li>"); } echo("<li style=\"border:none; font-size:18px; margin-top:-6px;\"><a href=\"$url&p=all\" class=\"paginationArrows\">All</a></li>"); echo("</ul></div>");
-
CubeCart Lite is good for a small store, and can hide prices until logged in.
-
Please make sure every PHP statement ends with a semi-colon (a couple of exceptions).
-
Never had to do that before. Thanks.
-
I have noticed that my browser does not put the red squiggly line under misspelled words in the editor window. In another forum I frequesnt that uses IPBoard, the browser does show the red squiggly line. Is it the case that this version of IPBoard, or an admin setting in this board, has switched off my browser's ability to spell check?
-
// Somehow add in the following data // $field5 = $hiddenDataValue1; How is process.do supposed to receive it? My experience suggests that to send data off to another place can be solved by using cURL.
-
Using .htaccess to make my URL's SEO friendly
bsmither replied to craigj1303's topic in Apache HTTP Server
I don't know how one would code massive amounts of ReWrite .htaccess statements (the following is only representative and not syntactically correct): if (39) then (balmoral) if ... if ... [301 whatever] The users of the application I mentioned have created a site map, told Google to dump all previous indexed scans, and submitted that sitemap. This is in Google's Webmaster Tools. I have no practical answer on how to implement an immediate solution. -
I would try two things: Use backticks to surround all table and column names (avoids accidental use of keywords perhaps such as by) Use single quotes to surroung names of keys in arrays: $_POST['title']
-
How does one select page 2 (second group of nine)? My experience gives me pagination that looks like: Page 1 of 6150 [1] 2 [3] Next All each being a link with ?page=X as the querystring where X is a page number, the current page number plus 1, or the word All. The PHP tests for the value of $_GET['page'] and sets the query parameters appropriately.
-
Is validate[required] a valid class attribute?
-
What am I doing wrong? Not getting errors in log
bsmither replied to ballhogjoni's topic in PHP Coding Help
The Errorlog statement in the VirtualHost block records web server errors. In the script, try adding: ini_set('log_errors', true); ini_set('error_log', "phpError.log"); If the script crashes before PHP has a chance to set those settings, also try to add the equivalent statements in the .htaccess file. -
Can you show us the pagination() function? Regarding the statement as seen in hyperlink.txt that you provided, is it correct? pagination($numResults,$p,$rangeP); I ask because I have to assume the function echoes its results instead of returning them.
-
Using .htaccess to make my URL's SEO friendly
bsmither replied to craigj1303's topic in Apache HTTP Server
From an application I am very familiar with, this is the approach taken: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA] Given: http://www.mycompany.co.uk/ranges/balmoral.html if this isn't an existing file or directory, take ranges/balmoral and set it as the value of the querystring key seo_path. The result will be: http://www.mycompany.co.uk/index.php?seo_path=ranges/balmoral Query a database table holding all the derived paths for the matching item and item_id: | ranges/balmoral | show_range | 39 | -
May I suggest: WAS: while ($row = sqlsrv_fetch_array($results, SQLSRV_FETCH_ASSOC)) $roster[] = $row; { echo json_encode($roster); } Now: while ($row = sqlsrv_fetch_array($results, SQLSRV_FETCH_ASSOC)) { $roster[] = $row; } echo json_encode($roster);