Jump to content

[SOLVED] Need To Capture String Data in Form Before It's Sent


inferium

Recommended Posts

Hi all. I've been google searching for a little while now and I can't find anything that I understand that can help me do this. Basically, I have an HTML form that uses POST to send to an external server. I need to be able to capture the string data that is sent, so that we can debug a problem we're having with the information not submitting correctly. The tech at the other company suggested using a server-side script that would allow us to do this, but I have no clue where to begin.

 

The code I am using for the post is as follows:

 

<HTML>
<HEAD>
</HEAD>
<BODY>
<center>
<H2><U>PartnerWeekly Lead Form</U></H2>
<form name="partnerweeklyform" action="https://pwlss.com" method="POST">

<input type=hidden id="process_page" maxlength="50" name="process_page" value="auto_loan_post" />
<input type=hidden name="zoneid" value="240185">
<input type=hidden name="source_url" value="http://eliteautoweb.com">
<input type=hidden name="client_ip" value="">

<TABLE align="center" WIDTH="600">
<TR>
<TD>

<TABLE>
<TR>
<TD>Ping App ID:</TD>
<TD><input id="ping_app_id" name="ping_app_id" type="text" length="20"></TD>
<TD> </TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD width="120"><label for="name_first">First Name:</label></TD>
<TD><input  id="name_first" maxlength="40" name="name_first" size="20" type="text" /></TD>
<TD width="50">&nbsp</TD>
<TD width="160><label for="name_last">Last Name:</label></TD>
<TD width="200"><input  id="name_last" maxlength="80" name="name_last" size="20" type="text" /></TD>
</TR>
<TR>
<TD><label for="address_1">Address 1:</label></TD>
<TD><input id="address_1" maxlength="40" size="20" name="address_1" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="address_2">Address 2:</label></TD>
<TD><input  id="address_2" maxlength="40" name="address_2" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="city">City:</label></TD>
<TD><input  id="city" maxlength="20" name="city" size="20" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="state">State:</label></TD>
<TD><input  id="state" maxlength="20" name="state" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="zip">Zip:</label></TD>
<TD><input  id="zip" maxlength="40" name="zip" size="20" type="text" /></TD>
<TD>&nbsp</TD>
<TD>
<label for="phone_home">Home Phone:</label></TD>
<TD><input  id="phone_home" maxlength="10" name="phone_home" size="20" type="text" /></TD>
</TR>

<TR>
<TD>
<label for="monthly_rent">Monthly Rent:</label></TD>
<TD><input  id="monthly_rent" maxlength="10" name="monthly_rent" size="20" type="text" /></TD>
<TD>&nbsp</TD>
<TD>
<label for="phone_mobile">Cell Phone:</label></TD>
<TD><input  id="phone_mobile" maxlength="10" name="phone_mobile" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="birthdate">Birthdate:</label></TD>
<TD><input id="dob_month" maxlength="2" name="dob_month" size="1" type="text" /> / <input id="dob_day" maxlength="2" name="dob_day" size="1" type="text" /> / <input id="dob_year" maxlength="4" name="dob_year" size="1" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="rent_or_own">Rent or Own:</label></TD>
<TD><select id="rent_or_own" name="rent_or_own"><option value ="Rent">Rent</option><option value ="Own">Own</option></select></TD>
</TR>


<TR>
<TD><label for="address_length">Time@Address:</label></TD>
<TD>Yrs: <input  id="address_length_years" maxlength="2" name="address_length_years" size="1" type="text" /> Mos:<input  id="address_length_months" maxlength="2" name="address_length_months" size="1" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="social_security_number">SS#:</label></TD>
<TD><input  id="social_security_number" maxlength="9" name="social_security_number" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="employer">Employer:</label></TD>
<TD><input  id="employer" name="employer" size="20" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="job_title">Job Title:</label></TD>
<TD><input  id="job_title" maxlength="80" name="job_title" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="timeemployer">Time@Employer:</label></TD>
<TD>Yrs: <input  id="employer_length_years" name="employer_length_years" maxlength="2" size="1" type="text" /> Mos: <input  id="employer_length_months" name="employer_length_months" maxlength="2" size="1" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="income_monthly">Income (monthly):</label></TD>
<TD><input  id="income_monthly" maxlength="80" name="income_monthly" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="phone_work">Work Phone:</label></TD>
<TD><input  id="phone_work" name="phone_work" size="20" type="text" /></TD>
<TD>&nbsp</TD>
<TD><label for="phone_work_ext">Extension:</label></TD>
<TD><input  id="phone_work_ext" maxlength="80" name="phone_work_ext" size="20" type="text" /></TD>
</TR>

<TR>
<TD><label for="bankruptcy">Bankruptcy:</label></TD>
<TD><select  id="bankruptcy" name="bankruptcy"><option value ="Yes">Yes</option><option value ="No">No</option></select></TD>
<TD>&nbsp</TD>
<TD><label for="cosigner_available">Cosigner:</label></TD>
<TD><select  id="cosigner_available" name="cosigner_available"><option value ="Yes">Yes</option><option value ="No">No</option></select></TD>
</TR>

<TR>
<TD>Price:</TD>
<TD><input id="price" name="price" length="20" type="text"></TD>
<TD>&nbsp</TD>
<TD><label for="email">Email:</label></TD>
<TD><input  id="email" name="email" length="20" type="text"></TD>
</TR>

<TR>
<TD>Pref. Monthly Pymnt:</TD>
<TD><input id="preferred_monthly_payment" name="preferred_monthly_payment" type="text" length="20"></TD>
<TD> </TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
</TD>
</TR>

<TR>
<TD align="center">
<HR>
</TD>
</TR>

<TR>
<TD>
<TABLE valign="bottom" align="center" BORDER="0">
<TR>
<TD>
<input type="submit" value="Accept" name="submit">&nbsp &nbsp <input name="cancel" value="Cancel" class="stdButton" onclick="JavaScript:GetLayout();" id="Button2" type="button">
</form>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>

</center>
</BODY>
</HTML>

 

 

What would be the best way to capture the string data that is sent in this form?

 

Thanks in advance :D

Link to comment
Share on other sites

As long as you have access to the server where this file is stored, change the following line;

 

<form name="partnerweeklyform" action="https://pwlss.com" method="POST">

 

to;

 

<form name="partnerweeklyform" action="data_test.php" method="POST">

 

Then create a php file called 'data_test.php' and add this code;

 

<?php
echo '<pre>';
var_dump($_POST);
echo '</pre>';
?>

 

This will show you an array of all the post data.

Link to comment
Share on other sites

My suggestion was for a fix and restore. I didn't realise you wanted to keep using the script while testing.

:)

 

You could even just use javascript, that onsubmit it runs a function that sends an ajax request to the page you want the data, that way the user never knows you are sniffing it (unless they view source) and it posts just fine and you get a log of what was entered.

Link to comment
Share on other sites

My suggestion was for a fix and restore. I didn't realise you wanted to keep using the script while testing.

:)

 

You could even just use javascript, that onsubmit it runs a function that sends an ajax request to the page you want the data, that way the user never knows you are sniffing it (unless they view source) and it posts just fine and you get a log of what was entered.

 

Hehe, we're actually using the form internally for our company. The server we're sending to is another company, and they won't let us access their server. As we're submitting finance lead information to the server, I can understand that :D

 

But yeah, javascript might actually be the way to go. I'm pretty much a php nooblet, so I'm not familiar with curl(). Do you know what kind of function that would be for javascript?

Link to comment
Share on other sites

Look into jquery.

 

You basically take the input from the boxes, by name or id, then use ajax to post it to a page. They should have plenty of jquery ajax examples of how to do it. So basically you are sending it to a php page and it processes it as post data. All in the mean time the information is also sent to that site.

 

Not that I condone this, but yea. That is the logic. 

Link to comment
Share on other sites

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.