Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Sounds like you need to develop your html page with the input form. The action of that form will call your php script which will grab the input fields from the form and do something with them. At the end that same script will send some html back with the results of your inputs. Yes - it does sound simple, so what are you leaving out?
  2. how are you getting your input? What does the ending url do for you? Can you show us anything you have written so far? How about your form that grabs your input values for field1= field2= & field3= ? Have you ever programmed?
  3. First thing that comes to mind is to create a cron task that runs at a defined time like every 1 minute and checks for some info in a table of a txt file that tells it what to post. Or the cron task runs once and is created and schedule at some future time. Using the first one would just mean that when an upgrade is done your script would just post some info about it in a table and when the cron task next runs it would look for any un-handled records, grab the info and do the 'post' and then mark the record as done.
  4. good time to forget this thread before I get in trouble.
  5. Why do you check both the GET and POST arrays for your input? If you truly don't know how it is coming in (or it can come in differently each time), why not just check the REQUEST array?
  6. Try adding this to your query: SELECT DATEDIFF(day,'2008-06-05','2008-08-05') AS DiffDate you just have to ensure that your dates are in the correct format (this appears to be yyyy-mm-dd)
  7. Didn't you already post this ridiculously long piece of confusing code somewhere else and get told not to?
  8. I'm sorry you feel that way. I'm also sorry that you don't see that I am actually trying to help you learn php by asking you to write some code. Apparently you need someone else to write your code and another person to interpret your code and another person to add code to it that the first person forgot to include for you. Good luck young man.
  9. If you have a good example of a phone validation, why aren't you using it? Oh - you want us to write it for you. What kind of validation do you want? 1 - test the value for a numeric only value; 2 - test for a valid length - depends on your expected inputs I suppose. I'd check for 7 or 10 myself. 3 - test for a 10 digit number that doesn't begin with 0 or 1; (BTW - I would only accept numbers without formatting in my input fields. Formatting can be added when I display it.) Ok - now that's the algorithm that I would use - you code it up. Of course if that's not the algorithm that works for your area, then ignore it.
  10. Actually if you are just presenting code you took from someplace else, how do you call that learning? NO - We are here to help you with YOUR code. We are not here to read somebody else's long posting that you have decided to use without even knowing what it does or how it works. If you haven't learned enough to take on the task you've chosen, then why should some volunteer (us) be asked to do it for you?
  11. Good luck with that site. I wasn't annoyed - simply conveying to you that good posting should only include enough code to help the readers see your problem and help you to solve it. Not so much that they have to read a book to make sense of it. And actually - this site is pretty much a beginner forum as well......
  12. Once again - you've posted too much code. Not interested in all that other stuff - looks like you'll have to dig it out.
  13. First of all - I would never mix my html and my php the way you (and many many others are doing). I would do this in my php section before I began my html output: $color_opt = "'" . $ar[0] . "'"; $color_nm = $ar[1]; which is the color value obtained already from my previous code snippet bracketed inside two single quotes. then in my html section where I am outputting everything : <span class="previewtext" style="color:$color_opt;">$color_nm Text</span So much easier to read and type <span class="previewtext" style="color:<?php .$ar[0];?>;">Black Text</span>
  14. 1 - I don't go to outside links. Ever. Just a phobia I have. 2 - You mentioned that you were new to php, but you are asking about a javascript function. Which language do you have the question about, since this is a php forum. Suggestion - put an alert or two in the js code that you showed us and make sure that you are actually getting to that code and what the code is doing. If the problem is not in the JS code you gave us, then perhaps you want to show us the pertinent php code?
  15. Assuming that code is some JS, what seems to be the problem, other than all you do is check if something is present.?
  16. Show us the part where you are checking the phone number and trying to validate it? That part. Or haven't you tried to look at this code yet?
  17. Would you really like to have to go through miles of someone's code to help them with a query problem? I don't. How about isolating your own problem and displaying the query before you run it and then verifying that it ran with a check and then asking us to look at just that much of your code?
  18. Could you just show us you attempt at the validation and NOT all that meaningless JS and outside code?
  19. Sorry - I read your first response incorrectly. YES - you are typing it incorrectly and you are attempting to extract the retrieved values incorrectly. To retrieve your values you use the explode function on the input value in the POST array which I showed you. Then wherever you want to display one of those two values you simply output one element of the array - the '0' element for the numeric value or the '1' element for the name value. So to display both values you could have this in your script: echo "You have selected a color value of " . $ar[0] . " which is the color " . $ar[1];
  20. Every once in awhile someone posts a bizarre php statement that confuses me. Here is yours: session_start(); if(isset($_SESSION['username'])) ?> <?php // Connect database. $con = mysql_connect("*****","*****","*****"); blah blah blah You check if you have defined your username variable in the session and if so ..... What? And if not you do some work, but what for? I'm guessing if the username exists you don't want to do anything, but that's not what I see. Besides - does this code even run without an error or a warning? You've go this dangling if statement.
  21. Despite the overall goal of this exercise, the easy way to accomplish what I think you are asking is (and BTW - try to post a REAL question in your topic header next time!) to make your value attribute contain both things. <option value="#000000|Black">Black Frame</option> Then when you retrieve it do this: $sel_ar = explode("|",$_POST['frame']); This will give you an array with: $sel_ar[0] = "#000000"; $sel_ar[1] = "Black";
  22. Sessions are nothing to worry about - at least as far as storing info goes. You attempt to store a var username in the session array.and then try and retrieve it in another script, but you use the wrong name. Remember - case sensitivity matters. If that is not the problem, then why exactly DO you use two different spellings of the same word as a variable name?
×
×
  • 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.