Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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.
  2. 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.
  3. 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?
  4. 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.
  5. 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.
  6. 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)
  7. 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.
  8. 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.
  9. 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?
  10. Showing us the contents of $dir for each of those six might help. As displayed, we don't have any info.
  11. Sounds like you started in way over your head.
  12. You haven't assigned an id value to the dropdowns. JS can't see them.
  13. 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.
  14. 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.
  15. 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.
  16. You have a need to have a network of servers for your content, yet you don't have your first server even up and running?
  17. 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.
  18. 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.
  19. 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.
  20. 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)
  21. ginerjm

    php error

    An array reference must look like: $_array['indexname'] which you are not doing
  22. How much "text" is there in a PDF file? The ones I've managed to look at are pretty much gibberish.
  23. Yes - that section is what you think it is. So - if you have used "some" php, why not continue to use this part as well? His use of "?p=xxx" is not just the use of PHP, it is a standard url with a GET parm. Or are you looking for some php code to resolve the existing urls? Or are you done with this problem?
  24. 'javascript: alert('".$row['Mobile']."')>".$row['Name']."</a><br>"; Don't use an <a> tag to host your onclick, just make it a <span>. Also convert to a js function call like this. <script type="text/javascrpt"> function showMe(num,nam) { alert('For: ' + name + " Mobile #: "+num); return; } </script> in your html: echo "<span onclick='showMe(\"". $row['Mobile']. "\",\"" . $row['Name'] ."\")'>$row['Name']</span>"; Now you are just executing JS and not making any kind of html action.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.