-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
The message I received from the OP says to delete this post. Guess he couldn't wait for someone to write his code.....
-
And why did you not post your code (PROPERLY) here so that all can help you? Be sure you have php error checking turned on. I'm sure they taught you that.
-
Uh.... school project? Doesn't that imply that YOU are supposed to write something? You write it. We'll help you correct it. What's wrong - you skipped too many classes to even make the attempt here?
-
Seems rather complex. Why not a single form with several radio buttons (with labels!) and one submit button. The value of the radio buttoncan give you your needed id. I failed to see your desire to avoid these.
-
Not sure on the format of the url value you supply, but how do you intend to 'pass' this value using the form you displayed? There is no submit entry.
-
It sounds more like you are asking about data storage than php programming. Not sure I understand this "trophy" conversation but it sounds like you are talking about awards won by the game's designers and you want to list them to let your viewers know about them. So - for each game I would link that record to another table that has individual records for each game's awards/trophies. Of course - if these awards are actually won by multiple games then you may want to just have a table of "trophies" and link those records to each game that has won one. Two different schemes but very similar.
-
Sarcasm? I suggest you re-read my post.... The difference is you only create an array that has immediate usage as in when you have an error to output only then do you bother to store it. Plus - from a maintenance POV - you can keep track of exactly where an error message is derived from instead of trying to relate a set of them stored off to the side and where the code is that triggers one of them to show up. You also can easily check if you HAVE any errors by doing what I said instead of having to keep track of some kind of switch that tells you if you want to output any errors. Basically, it's just simpler.
-
PHP ... simply manipulating arrays? Wow - I would have never thought of that. There is so much much more that one can do with PHP. It is incredible how many extensions/add-ons have been written to complement native PHP that for someone to boil it all down to "manipulating arrays" is hard to fathom. Glad to see that mac_gyver figured it out for you. As for how to handle error messages - you tried one way but it's kind of backwards. Instead of storing your set of canned messages use an array to save generated messages. You can do it with just a numeric (default) key that is meaningless or with a named index to help you decide how to output them, but the values will be whatever message you want to eventually output. So - as you go thru your processing and accumulate errors you build/manipulate this array and at the end of your logic test if the array is empty or not and then output it or do whatever you intended to do with the user's input.
-
Obviously the form is no valid since you are not getting anything back. That's why I asked that you LOOK at the web page content using the 'view source' option of your browser to see what you have out there. You can certainly "go scour" but the short answer is to go see what is (NOT) getting sent. PS - When I took JUST your form's code and put it into a little test script I managed to get it sent. I then made entries for the two problem input elements and clicked on the Update button and got back data. So - the form code is valid (as you say) and works when clicked. Therefore - I'd say your script is NOT sending it in the first place.
-
Back to the topic at hand.... So - I want you to look at the source code of your displayed web page and make sure you have a valid "form" entity in it. To get the output that you say you received tells me that you did not get a proper submit from this form of yours so I'd have to question what got sent to your page.
-
Assuming that this: if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Error declaration $error = ["Your file is too big!", "There was an error uploading your file!", "Cannot upload file of this type!", "Empty fields!"]; // Process POST variables $videoTitle = $_POST['video_title']; $videoDesc = $_POST['textarea-videoDesc']; is where your error is occurring, add the following: echo "<pre>",print_r($_POST,true),"</pre>"; right after the "Process POST variables" comment line. Let's see what your POST array has in it!
-
Ok - you've added a third block of code and again - What is the realationship between all of these? Which one comes first?? I have to ask this before considering the possible reasons for your error messages. At first glance your error is because you haven't yet received the submit from the form, hence there is no post with those elements in it. IMHO the way to write this script would be to first check if the post has been received by checking the $_SERVER['REQUEST_METHOD'] for a value of 'POST'. If you don't have it yet then don't go processing anything from that form. Keep moving on down your script until you get to the part that displays the html and then exit and wait.
-
You showed us two separate blocks of code. What is there physical relationship in this script? Does the first block get executed when the second has not been run yet? Do you actually confirm that you have a post array at some point?
-
What happened to your last hugely complex and incomprehensible posted topic? I was reading it just to see what it ended up being but didn't see a resolution. On to a new topic to confound your readers already?
-
Submit large form created with select statement
ginerjm replied to Adamhumbug's topic in PHP Coding Help
You vastly improved your form code with your second posting but then you added some new problems. If you are using an array for the multiple instances your input items then LEAVE OUT THE INDEX. What good is it to define a single index for your array elements when you want to have multiple instances of that element?? They are all going to be id'ed as element 'equipmentId'. (PS - leave out the up and lower cases in php - it's just a pia down the road.) PPS - you still have a tag outside of the td elements that will get displaced when output. Other than that - I have no idea what your goal is here. -
It is really incredible how MANY different problems you encounter and have to post for us to puzzle over. So much stuff I have never imagined could be in existence and you seem to come up with reasons why they don't work for you. Do you just spend 24x7 researching things to learn about? Or do you have such a diverse workload that you have to learn all of this "stuff"? All of the things you have posted can't possibly all be connected, can they? If so it must be one heck of a project!
-
Is there a way to convert Bitcoin to Satoshie and vice versa?
ginerjm replied to imgrooot's topic in PHP Coding Help
I may regret asking this but - are you sure about that? Is going from a to b involves division, wouldn't the reverse involve multiplication? -
Besides the advice that Requinex has provided, the substr function counts 'characters', not 'words'. If you really meant to say that you wanted only 15 words, then you need to do something else.
-
If you are attempting to produce a working script, I hate to remind say this, but you ARE trying to be a developer. And if you want to do it correctly, saferly and securely you have to be a GOOD developer.
-
Sounds like sarcasm, which won't get you much help anywhere. You have apparently 'found' this code somewhere and think that it is a good starting point for your project. The only thing is that it is outdated and should not be used. If you were actually learning PHP you would have discovered that by now. You have been given some good advice which, if you are seriously considering 'learning' php, you should follow. Don't go off and sulk with one final silly comment. PS - you need to recognize the mistakes you are making in your English too: filed - was probably supposed to be 'filled' the first time you used it filed - was probably supposed to be 'field' the second time PHP variable names cannot have embedded spaces. PHP is also a case-sensitive language therefore you REALLY don't want to be creating variable names with all kinds of upper- and lower-case letters. You will be kicking yourself down the road as you forget how you named something earlier. Do you have any JS code in this script? Because if you don't then all those unique id names on your input tags are worthless since you can't reference them from PHP.
-
Again - please show the code. Like - the form html and how you handle the inputs and how you write the query.
-
Why don't you post some code for ONE of these problems and show us what is not working? Or do you just want us to write it for you? (NOT!)
-
Select & checkbox values don’t show up in submitted form
ginerjm replied to ThatGuyRay's topic in PHP Coding Help
Stop showing us tidbits of your code. Show us the WHOLE FORM and then show us the logic that is grabbing the inputs and how you are displaying the results. -
Select & checkbox values don’t show up in submitted form
ginerjm replied to ThatGuyRay's topic in PHP Coding Help
If you turned on php error checking you might see why. It is 'vehicle', not 'vehicles'. -
Where do you put opening curly braces when defining a method?
ginerjm replied to NotionCommotion's topic in PHP Coding Help
PS - I love the link Benanaman provided. Made my vote and found that I was part of the majority!! Allman all the way!