PHP GURU? - Quick question for you! :)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jizar II
    Confirmed User
    • May 2001
    • 1425

    #1

    PHP GURU? - Quick question for you! :)

    We need to submit some form info to a secure 3rd party server via method=POST, but we need to check up on the info in our local MySql db to make sure it?s not regged already before the info is passed on.

    Is this possible?
  • ThePornPusher
    Confirmed User
    • Oct 2003
    • 1823

    #2
    Yes, simply connect to the mysql database on the submit page, retrieve the row that you would like to see is already taken, then loop the submitted name and see if it matches up. If it does, then make a error handler, and that should solve your problem.

    Comment

    • Jizar II
      Confirmed User
      • May 2001
      • 1425

      #3
      Thank you for the reply Porn Pusher!

      The problem is that we don't know the username we need to check before it's entered into the form and submitted to the other server?

      Comment

      • Intrigue
        Confirmed User
        • Feb 2004
        • 662

        #4
        this is very possible, set the forms action to your php page, on the php page, check the database, and if you still want to send it on when your done, you have two options, either send an http request to the secure server (using headers to set the post variables) or pumping out a form, and automatically submit it with some hahahahahahahahahaha. the latter is easier, but kind of a jimmy rigged way of doing it.

        Comment

        • Jizar II
          Confirmed User
          • May 2001
          • 1425

          #5
          Originally posted by Intrigue
          you have two options, either send an http request to the secure server (using headers to set the post variables)
          I would like to do it this way, but will the target server see this as a true POST?

          Comment

          • woj
            <&(©¿©)&>
            • Jul 2002
            • 47880

            #6
            Originally posted by Jizar II


            I would like to do it this way, but will the target server see this as a true POST?
            yes
            Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
            Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
            Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

            Comment

            • Jizar II
              Confirmed User
              • May 2001
              • 1425

              #7
              Originally posted by woj


              yes
              cool! can you code a quick example for me? Then I'll paypal you some

              Comment

              • woj
                <&(©¿©)&>
                • Jul 2002
                • 47880

                #8
                hit me up on icq 333.75924
                Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
                Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
                Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

                Comment

                • Carlito
                  Confirmed User
                  • Dec 2001
                  • 856

                  #9



                  $checkuser = "SELECT name FROM form_users WHERE name='$name'";
                  $query = mysql_query($checkuser);


                  if ( mysql_num_rows($query) >= 1 )

                  {


                  print "<font face=verdana size=1 color=#6e6e6e>Sorry, the username you have chosen is in use.<br>Please go back and create another, or get in touch with a staff member<br> to restore your current username & email.</font>";

                  }

                  else

                  {



                  $uname=escapeData($_POST['name']);
                  $email=escapeData($_POST['email']);
                  $url=escapeData($_POST['url']);
                  mysql_query("insert into form_users (name,email,url) values ('$name','$email','$url')");
                  $user_id=mysql_insert_id();
                  unset($_POST['name'],$_POST['email'],$_POST['url']);


                  I use this on something I just coded.

                  Comment

                  • Jizar II
                    Confirmed User
                    • May 2001
                    • 1425

                    #10
                    Originally posted by Carlito


                    I use this on something I just coded.
                    Hey thanks! I'll see if this will work

                    Comment

                    Working...