-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Their site lets you add html code to it? Interesting. Really???
-
Get rid of all those divs!!! Needless. Plus your initial post shows only 3 input fields - where are the rest. The interface between html and php is the vars identified by the "name=" attributes of input tags. Plus handling checkboxes is tricky for newcomers so you should google something like "php handling checkboxes" and look for a good example. Plenty of them out there.
-
HTH. I'm still confused by your last posts, but you marked this answered, so my work here is done.
-
I don't know what you are talking about. The usual process is: script builds page and sends blank input fields in a form user fills in form and hits submit script reads the input vars from POST and validates them, cleans them and does a query to post the db (basically). Then script either sends back an empty page again for the user, or sends back a new page with different info on it based on what the user did on the first screen. Not sure what you are trying to say here: "The problem is once data has been uploaded it does not dynamically display on page" Of course it doesn't dynamically display - you have to send it, whatever it is.
-
Truly - since you are not doing a filter there is no sense using this new function. See my example for handling input above. I believe that's how most people process input. That and escaping the potential "bad" data input that could go into a db. as for your if statements - look them up in the php manual - the php programmer's best friend. if (conditions) { statement; statement; } else { statement; statement; } Note the placement of the semis.
-
As for the error message, you probably have a stray space character or blank line in your script and that is the data that is being sent. Actually it tells you what line to look for, so see what's there. As for your question - Let me see if I have this straight. Your user puts info on the page and hits submit. You do you updates. Now - what "updates" do you want to see on the page after the db has been updated? Anything that the user didn't input you would obviously have to send back to the page (along with the previous input vals of course) so yes - you have to refresh the page in a sense. Are you doing this update via ajax/js or thru an actual submit button calling a php script?
-
Good catch! And I got to thinking - if you are not applying a Filter with the 'filter_has_var' function, why use it at all? Perhaps the user is new and doesn't realize that there is a more straight-forward way to capture input values from a form? I actually had not heard of these functions until now.
-
When one has problem, one usually traces thru the program with echo statements to help you know what is going on with an exit at some point so that you can track how far you got and remove them and add more later on in the stream. That works fine in a development environment when you don't have a real debugging tool. But in this case I think I've shown you the problem.
-
Also - notes on "filter_has_var" say that an empty value returns true. That could be your problem. Why not : $var=''; if (isset($_GET['var'])) $var = $_GET['var'] if ($var == '') (show error)
-
Great! Your answer is at least a start. Now add some debugging (echos) to tell you what you ARE getting and see if that isolates it some more.
-
The usual practice for seeking help on a forum is to tell us what is wrong. Not to ask us what "might" be wrong. Give us any error messages your are getting back. And don't give us oodles of code to try and follow. Isolate your problem (thru your normal debugging methods) to the section of code you suspect and just give us that. Please.
-
Combine rows together in one email instead of single emails
ginerjm replied to ScreanerHS's topic in PHP Coding Help
Way too much code to wade through! But - it appears that you are trying (?) to create an html-style email message using a table to display the pertinent information. Fine. Start your html table before your results processing loop. After that code use your loop to grab each row of data, create a new row of your table. Once the loop is over, write out the html to close the table and finish the body of your email. Basically: $msgbody = (introductory message); // start table $msgbody .= "<table><tr><th>xxxx</th><th>yyyyy</th><th>zzzzz</th></tr>"; // begin the loop while ($row = xxx) { $msgbody .= "<tr><td>$row['abc']</td><td>$row['def']</td><td>$row['ghi']</td></tr>"; } // end the table $msgbody.= "</table>"; Am I close? -
Showing us the contents of $dir for each of those six might help. As displayed, we don't have any info.
-
Sounds like you started in way over your head.
-
You haven't assigned an id value to the dropdowns. JS can't see them.
-
Sorry - but I can't see your arithmetic problem in this code. I do however see some very questionable tactics throughout your code. Can you explain what the first line ($_POST["filter"] is doing? That and the later line ($_POST['submit'])? Don't they give you some kind of error? Also - what is the purpose of the sprintf function use when building your query statement? Also - do you really mean to create a complete table for each and every row of your results? And - why the closing </font> tag at the end of the table, but individual opening font tags for each td element? As for the math issue, perhaps changing your update query to drop the quotes on numeric values - AFAIK you only need to quote string values, not numeric ones.
-
I actually downloaded a script generally named PDF2Text.php and attempted to work thru its processing. Seems to me that the script is putting out the formatting chars from the PDF and not the ascii text, or something very close to that. My debugging followed the process of identifying and separating out the pdf objects but my lack of knowledge of regex statements failed me in the last function named getTextUsingTransformations. Perhaps if you know more about regex you can decipher what is supposed to be happening there.
-
Egg on my face.... Curious, I downloaded the item that I believed would do what you wanted. Sadly, it failed. So did the next two methods I located. So it seems that the problem is still in need of a solution.
-
Yes - you did say something else. You want to read a screen that is displaying the contents of a pdf. It took me all of 5 minutes to find out how to do it on google. I'll let you do the same.
-
So OP - have you taken Psycho's advice and fixed your initial problems? If you have I hope you also have learned to turn on error checking, validate your inputs, and practice safe data updating. Your code is woefully lacking in any of those things and you are only asking for trouble down the road. Must each row contain all of these fields? You don't check for that. Also - since you are using arrays as your input values, you may have a problem with the last field - your datetime one, since you are not providing an array of values for it. You say there are no errors showing. Well since you don't run a query I can believe that, but without error checking turned on, you don't even know if your script has other errors. PS - is "size=20px" a valid attribute of an <input> tag? I think it's just "20". Looking forward to your next post.
-
It's still a login system. The code that is triggered by the user when he selects the video needs to pass in the video name to your login script (which all selections will call). Your login script does the validation while saving the parm passed into it and once the user is cleared, you then call the "display" script passing it the parm with the video name to be displayed. Ex. html anchor tags (?) with the names of the videos (?) and an href like this: <a href="videologin.php?name=videoname1">videoname1</a> <a href="videologin.php?name=videoname2">videoname2</a> etc. In your login script $videoname = $_GET['name']; (do your code to display the login screen storing the videoname as a hidden field on that screen) (do your code to handle the input credentials and to check them) be sure to retrieve the hidden videoname: $vidname = $_POST['videoname']; then call your display script: Header("Location: displayvideo.php?name=$vidname"); In your display script: $videoname = $_GET['vidname']; (now do your code to put up a video player with the $videoname file) I would do this as 3 programs - one to show the video names for the user; one to do the login process; the third to do the video playing.
-
enable and disable row in mysql table using a html button
ginerjm replied to hance2105's topic in PHP Coding Help
You said in your other post to come here and work on this one. Yet - you have already been given the answer yesterday. Run with it! (A pretty simple fix it is too - maybe you DO need to do some reading)