Jump to content

[SOLVED] How can I process inputs if I cannot access main php script


Recommended Posts

I am using a proprietary/encoded php script to process inputs into a table.

 

My program is structured  like this ...

 

      <?php

require "$root/include/config.php";

        .....

require "$root/include/proprietary_code.php";

        ......

      ?>

     

      <form action="" method="POST" onsubmit="return check(this)">

      ....

      <?php input($_POST['email']); ?>

      ....

      <?php input($_POST['input2']); ?>

      ....     

      <?php input($_POST['input3']); ?>

      ....     

      <input type="submit" name="Submit" value="enter">

      </form>

 

The check(this) is javascript that checks for syntax, empty fields, etc and holds up the POST until they are correct. The proprietary code builds my table and does some input processing like removing ">","<","?", and "|", but as far as I know, does not do all the good things that are recommended, like htmlentities, or mysql_real_escape_string

 

I would like to add further input processing. Being a php noob.

 

If I include a php file above the required proprietary form, then it can grab the inputs first when the form is submitted?

 

If so, than how would I pass them on to the proprietary code. The code would have to simulate another POST submittal?

 

Any help?

 

 

 

 

 

 

If you have proprietary code that doesn't do something basic like mysql_real_escape_string... why use it?  Sounds like it either sucks or is way out-dated.  But anyways, you can have the form post to your own script, do your stuff and have the script send it to this proprietary script via curl

If you have proprietary code that doesn't do something basic like mysql_real_escape_string... why use it? Sounds like it either sucks or is way out-dated.

 

Cuz I haven't coded since 2001 and it wasn't PHP or Java. :) But am getting into this. Anyway, I need to understand the $_POST[] better.

 

I found a place where the data was available in the php code. Later in the HTML code, the author rewrote the form with hidden values for all the inputs. He then redid all the POSTS in the next php module, i.e. $user_input= $_POST[user_input];

 

So because they were hidden, these POST entries don't show in the source code of the browser, but exist?

 

Anyway, at that point, I opened the database to enable mysql_escape_strings(), applied htmlentities, and both functions worked. Can see the results in the database when I insert bad inputs. I feel better.

 

Also, thanks for telling me about curl. I am going to play around with it.

 

Hmmm, can't find the "Marked Solved" button.

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.