-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Uhhh - What exactly is 'the' problem?
-
How about just posting the code you want help with? Page 9 has several topics on it but you didn't point out which one you need help with , not that we could help you without seeing the code. When it comes to sessions, I'm not sure what you mean by verifying the user is on a 'validated session'. Do you mean how to detect if the user has previously logged on because the session will be valid, it's probably just the user you are concerned about validation of.
-
You said you wanted things 'like' wid but you wrote a query looking for = You wrote your query statement with a substitute parm for your where clause but then you didn't prepare it and assign the parameter. You ran your query and tried to process it without checking if you had any results. You wrote your output to a table row but you never ended the row (nor did you begin the table). You said you wanted like, so I would expect there to be multiple rows in this html table, but you aren't prepared to handle them. Fix all those things and be sure to have error checking turned on and let us know.
-
When I click on Formbutton, nothing happens
ginerjm replied to michaeladewale2010's topic in PHP Coding Help
It is true that you need something to do a submit, but in this case it might be some javascript doing it instead of a form button. As for your editing attempt - you have to actually have the source code to edit and it appears you are trying to edit it on somebody's server somewhere. FTP the file down to your pc and then edit it. But then you have to ftp it back too. As for locating the page, you haven't given us any page names (scripts) other than index.php. Have you looked at index.php yet?- 1 reply
-
- php
- formbutton
-
(and 1 more)
Tagged with:
-
So - you are not making multiple 'sessions', you are storing multiple values into a session var. Something like: $_SESSION[$id][] = (something); would create an array of $id elements, each of them having an array of 'somethings' stored.
- 10 replies
-
- session
- auto increment
-
(and 1 more)
Tagged with:
-
get new num_rows count after filtering mysqli_fetch_array rows via php
ginerjm replied to seany123's topic in PHP Coding Help
Why not save each $row into your own array if it is one you want. Then you can get the count of that array when you are done and use that array as your data source from that point on. if ($result[0] == custom_function($result[0])) { $my_results[] = $result; } $my_results will hold all the 'valid' rows from your query. -
To answer NotionCommotion: Huh? I have no idea what you are trying reconcile with me. Don't care either.
-
Which is why my code is stored outside of the root folder.
-
Great topic name. Aren't all the posts here basically 'php questions'?
-
Your use of the term 'sessions' is confusing. What does it mean? What do you think a session is? It will be forever confusing if you continue to use that term since it is in conflict with PHP's own $_SESSION array and session handling procedures. As for the rest of your description - don't have a clue what you are doing. Why not try and describe it in plain English and leave out the programmer's aspect of your tasks.
- 10 replies
-
- session
- auto increment
-
(and 1 more)
Tagged with:
-
This is a helper forum, not a coding forum. If it's so simple (and it is) you s/b trying to write some simple code. As it stands, I don't follow what you are trying to say. You talk about seeing a link, clicking on that link, adding a link and saving a link and counting how many times one of those is clicked on. WTH are you doing?
-
Hate to say it but this seems to have many solutions available using a google search. Did you think to try that first? The topics all agree that you do : serialize urlencode urldecode unserialize
-
A simple returned message can do this for you. Why not let the called script return the exact message you want to pass to the user instead of making the caller deduce some msg from whatever you are proposing to do? Let's face it - if the rejection is based upon a logical error or programming error then you need to re-write something. OTOH if it's simply a matter of a business logic error or user-input error, shout it to the user!
-
Again - Why Why Why? What is wrong with your ajax-called script returning a simple error message to the caller? Or is there something else you are not telling us, like this is destined to be a universal target for other apps to use and the error message has to be more generic instead of specific?
-
-
List categories by type and list subcategories by order
ginerjm replied to afaaro's topic in PHP Coding Help
Happy to hear that. Was tired of trying to communicate. -
So now that it turns out to be a response from/to an ajax request, my point remains the same. Notion - you began this topic with the concern about using the "correct" header for a response. Again - why use something that today you can't even name for returning an inter-application reply? Just send back an error message that your caller will understand and react appropriately to. Why all the drama? Why should your two pieces of code have to use headers to convey a message? Seems like overkill to me.
-
PHP & MySQL - Calculation before inserting data into table
ginerjm replied to rvdveen27's topic in PHP Coding Help
A basic tenet of good db design is never to store a data value in a table where the value can be determined easily from other pieces of data in that same table. A simple straight-forward calc such as yours relying on fields stored side-by-side with this calculated field is wasteful, unnecessary and causes undo repeat calcs whenever one of the inputs to the calculation is modified. As pointed out already, the profit can ALWAYS be calc'ed as part of a query and this can always be counted on to be correct. What happens when a value is edited and the recently-written update job that does it fails to re-calc the profit using the new value? -
An erroneous http header is great? I dunno what you're doing down there, but have fun at whatever it is. I know that if I was using a website and it spit out headers for various diff codes instead of just telling me in plain English what I did wrong, I wouldn't frequent that site anymore.
-
A form builder? You mean to be used in your future endeavors when you need to write a script that will utilize a new form? Or to satisfy a requirement that you build random forms all the time using some massive set of varying inputs? Both seem kind of large tasks for a newbie to be experimenting with. Let's face it - given a task you design a form and write the html for it and use it in your php script. When will you need to re-write THAT particular form again that either a) you can't copy it, or b) well, there is no b. Forms are unique to each application in that you want your own titles for them, your own name= attributes and your own data requirements. If you actually have a future plan that will allow you to re-use the same sets of fields for your future forms then I guess this will work for you, but I think it's a long ways off to be using as a learning experience for html/php/sql knowledge. Just my $.02.
-
You could build your query statement dynamically as you loop thru your input fields. Use vars to represent the field names just like you will be doing with the corresponding values Are you sure you have thought out this design well? Seems kind of crazy.
-
Let me pose another question. Just what are these "sessions" you are referring to? Are they truly "PHP Sessions" for which you are trying to make a system to keep track of them all in one session? Because if so, I don't think you can do this since sessions are private and separate for each user by design.
- 10 replies
-
- session
- auto increment
-
(and 1 more)
Tagged with:
-
Wouldn't it be better to handle these conditions within your app with a more user-friendly response so they can fix and resubmit without dealing with the browser?
-
Use hidden fields in your form to hold the name of the db field that needs updating?
-
List categories by type and list subcategories by order
ginerjm replied to afaaro's topic in PHP Coding Help
You really need to work on your communication skills. Don't see the difference in your two examples unless it is the extra dashes on 'subcategory'. In any case, that is a "presentation" problem, not a php or logic problem. Show us your code and then we can perhaps fix it. But - really - your current posted code is not the way to go. Not at all.