-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Should I let users add comments without logging in?
ginerjm replied to man5's topic in PHP Coding Help
So - in effect - the users are "logging in", no? -
Should I let users add comments without logging in?
ginerjm replied to man5's topic in PHP Coding Help
If a user provides no credentials to post a comment, how do you know which previous comments are his? -
Create what instance? Set what variables? Mind giving us some more info?
-
Well, of course there is a way to do what you describe. Just write some code. And no - I (and the others in THIS forum) am not going to write it for you. OTOH we will help you with the code that you write - the active word there being 'you'.
-
Uhhhh.... Just use your php skills and make those changes?
- 2 replies
-
- contact form
- form
-
(and 1 more)
Tagged with:
-
MIght have helped if you had mentioned this was a WordPress thing. You can't edit the output of this script, or modify the script to NOT create the element?
-
How are these privileges "grouped together in a column"? Are you breaking one of the first rules of normalization?
-
Without trying to understand your code, I offer this suggestion. Why not create a group of vars set to False - one for each of your privileges? Then when you authenticate someone, turn on the vars (set them to True) that correspond to that user's privileges.
-
What do you mean? Remove an input element from the code? Delete some record that has a key matching the contents of the first input field? Very confusing question without much detail.
-
retain selected item from drop down list after php validation
ginerjm replied to laxi's topic in PHP Coding Help
obviously you didn't read any html reference to see how this was done. -
retain selected item from drop down list after php validation
ginerjm replied to laxi's topic in PHP Coding Help
You need to read up on your html. Add 'selected' to the <option> tag that was selected on your output side when you re-send it to the client. PS - It would be easier and smarted if you used your country array to generate the options in a loop - and it would help do the above enhancement easier. -
Aah! It's a js problem. Perhaps you should move this to the JS forum instead of the php one.
- 4 replies
-
- javascript
-
(and 1 more)
Tagged with:
-
Any use of the print button in your browser is not related to php. Is this print button part of the application or the browser?
- 4 replies
-
- javascript
-
(and 1 more)
Tagged with:
-
Jacques1 will have a field day with this post soon. Anyway - You shoud create one small include file that does your connect process and ONLY in that place should you put your credentials. Then that script should be stored outside your public web tree along with all of your other (my practice) important code. And yes - there are plenty of malicious users out there as J will tell you. Always always practice security.
-
Sure! In this forum you post your code correctly. Please see my answer to this exact same (confusing) question in the other forum you wrote in.
- 3 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
check db if a phone number was added to db less than 31 days ago?
ginerjm replied to lovephp's topic in MySQL Help
Assuming you are using the MySQL db there are lots of functions available for date/time manipulation. Check out this:' http://dev.mysql.com/doc/refman/5.0/en/func-op-summary-ref.html -
1 - you didn't post your code with tags as per the rules. 2 - you appear to be saying this is a JS problem. How about posting (with tags) in the JS forum instead?
-
Turn on error checking and see if $user has a problem. That's got to be it.
-
Way to hard to decipher your writing and understand what you are trying to say. And of course, properly posting your code would help us.
-
As the manual tells you (hint) MySQL_fetch_array returns what amounts to two arrays - one with associated indices and one with numeric ones. If you don't need both of those, save resources and pick either MySQL_fetch_assoc or MySQL_fetch_row. BUT OF COURSE YOU SHOULDN'T BE USING ANY THAT IS NAMED "MYSQL_*" since those functions are deprecated, slated for extinction, soon to be gone and generally frowned upon by the community in the know. And from this latest post it appears that you are seeing that your problem is less with the loop than the statements being placed within it. BTW - PLEASE follow the forum rules and use tags to wrap your code in. On this forum that is the 'code' and '\code' wrapped in < and > symbols.
-
Once again - it is in your code. If you don't understand how some functions work, either read up on them or don't use them. Somewhere in your code (and I'm not going to try and understand it again) YOU are outputting the data NOT in the way you think or want to do it. A good portion of any programmer's life in any language on any platform is spent in figuring out just where he/she went wrong. Time for you to expend some of that part of your life. Try and simplify your code. Break it up into distinct parts and make those parts finto unctions. Fine tune them until they do EXACTLY what you want and then put it all together with one set of code that initializes things, calls the functions to build those things and then outputs those things. Hate to be blunt like this but you really have to get a handle on what your code is doing and where you are doing it wrong.
-
Good luck in your goals. Really.
-
As for #1 - At the top of the page click on Rules and TOS. Go to Forum Guidelines. Read all of them, but most specifically #4. Warnings - I have no idea what netbeans gives you but apparently no proper php error checking. I'll post it here for you since you apparently didn't research the php manual. error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); Place at the beginning of any script you are developing. Errors? So many..... Major error is your use of php inside (or should I say outside of php) html code. You can't start a heredocs block in the middle of html which you do. Also I searched the manual for alternate syntaxes and could not find one that supports the following: $theResults: <<<EOD The only syntax uses an = sign, not a colon. If this is working for you, then perhaps the authors of the manual need to correct themselves. And while I'm discussing the chunk of code (html) you are not in php mode here so how do you expect the echo "$theResults"; to work? BTW - you don't need the quotes here. I'm sure once you turn on error checking as above you'll get plenty of messages in place of the blank page you currently receive.
-
Whatever do you mean by "simple loops" and that you need 'more advanced tutorials'??? LOOPS ARE SIMPLE! That's all there is. As KevnM says perhaps your 'problem' is not the loop but the code inside that gets executed upon each iteration. All a loop does is repeat a set of code for you. As KM says, break down your task into ONE execution of the code you have and make it work on ONE set of data until you're happy. Now wrap it in a looping construct and you have it. That's all there is. I find it impossible to believe that you have written any kind of code from start to finish that did not involve a loop of some kind. I also worry about the state of college level teaching of CSI if you could get a degree without understanding this concept. I apologize (kind of) if you found my last post too much to handle, but I think we all agree that your inability to pick this up from all the help that has been provided is mind-boggling and I let myself go into frustration mode. And - you don't have to quote back to me my entire post (as the rules state) when you have an issue or question about it. Really - we can all read it in its original spot.