Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Posts posted by ober

  1. I'm not sure I understand the question. You need to put the results in 2 different databases or you need to send the results onto 2 other processing files? I guess my question is why can't you put all processing of the form into one file? And if you can't, you could always process the first file and then use a header() call to send the process onto the second file.
  2. I don't honestly know to tell you the truth, but I'm about 96% sure that calling a PHP script via webbrowser would pretty much kill it if you just decided not to provide a return path for the results.... that may not be an exactly accurate description of why it would die, but I can't come up with the right wording at the moment.

    It can't hurt to try, but it appears that you've done that, without a positive result.
  3. Your function would have an input in the class:
    [code]function GetUserInfo($user) { [/code]

    And you would call it like this:
    [code]$cn->GetUserInfo($user);[/code]

    Alternately, you could also pass this as a value to the constructor and make it a global variable in the class if you plan to use it in other areas of the class.
  4. [code]echo '<script type="text/javascript">document.writeln(\'<img id="menu0Image" src="./images/minus.jpg" alt="Collapse"  onClick="toggle(\'menu0Image\',\'menu0List\')\';\'">')\';\'</script><br>';[/code]

    Give that a shot. You have to escape ALL single quotes.

    And I'm not sure why you're using an echo for this... surely you could jump out of PHP and just write that instead of echoing it.

  5. I think you're confused or I'm not catching on to what you're trying to do. I assume "getuserinfo()" is always going to have the same output.... so you would put the echos and whatnot in the class as well. Keep in mind that calls to functions in a class can work somewhat like a more powerful include().

    When you call the $cn->GetUserInfo() and you have your while loop and echos in the class, it will display all that information for you. You don't have to return it or anything like that.
  6. That's correct in most cases, but why should your user have to hit the back button??? You should be doing that for them.

    And at least for IE, you'll often get "Page Expired" errors when you try to go back to a form like that.
  7. You would generate the HTML the same as you would generate the page on your website, except that you put all the HTML code into a variable which gets passed on to the mail() call as the body.
  8. The proper way to do it is to have your validation code on the same page as the form. When the user submits the form it refers back to the same page and if the form results are invalid, you show the form again and the values are already there in the POST/GET. But you do all the validation before any HTML so if the validation is correct, you send the user onto a "thank you" page with the header() call. You can do the mailing after the validation or on the thank you page, it doesn't matter which one.
  9. And that's exactly what you should be getting. All you've done is create the object and run the constructor.

    You need to do something like this:
    [code]$cn = new MySQLConnect();
    $cn->GetUserInfo();[/code]

    But that's not going to output anything either, because you don't actually spit out your results, unless you're not showing us everything.
  10. [code]$query = "SELECT * FROM sample";
    $result = mysql_query($query) or die(mysql_error());
    if($result && mysql_num_rows($result) > 0)
    {
         while($row = mysql_fetch_array($result))
         {
              extract($row);
              echo "$field_a<br />";
              echo "$field_b<br />";
              // etc
         }
    }[/code]
  11. Are you deleting the record or just removing it from the display? If you're deleting the record from the database, you don't need an extra field. If you're just removing it from the display, all you need is an enum field that can be either 1 or 0.

    Keep in mind that when you submit a form with checkboxes, only the ones that are checked will be passed on.
×
×
  • 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.