pass data from a form to a different page - php

I have a form (Code Below) that will collect an email address and what I want is that it will then pass the collected email address to the next page to say something like "We have sent the information to email#email.com"
So page 1 will contain the form and will pass the email address to page 2
<form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl" >
<p>
<input type="hidden" name="meta_web_form_id" value="111111111" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="website" />
<input type="hidden" name="redirect" value="http://www.website.com/getstarted/" id="redirect_1ab97d9c11111111161e5b4a75554" />
<input type="hidden" name="meta_adtracking" value="My_Web_Form" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="email" />
<input type="hidden" name="meta_tooltip" value="" />
<input class="textbox_1" id="awf_field-111111111" type="text" name="email" value="" tabindex="500" />
</p><br />
<p><input type="submit" class="textbox_button" value="" name="cmdSubmit" tabindex="501" /></p>
</form>

Where is the problem? You have an input named email, if you visitor puts its email address yhere it will be sent to addlead.pl together with the rest of the form.
Page 2 is written in Perl, according to the extension, so you should tag your question accordingly: you won't find much help on Perl with a question tagged as PHP.

you mean you want the PHP code to get the information in the other page ?
$_POST['NAME OF THE FIELD']
EXAMPLE
$_POST['meta_web_form_id']

Related

Hide url parameters in php

I am not getting the way to hide the values that are passing through url in php. Clicking over a link , page redirects plus parameters are also shown on url .For eg:-
/localhost/oops/edit.php?id='1'
but I want to hide the data after ? while redirecting.
Your only option is to use a form and POST if the page your are logging into is controlled by a 3rd party. Try to use hidden input type while login. Maybe that'll work for you. For example:
<form action="http://mywebsite.com/login.aspx" method="post">
<input type="hidden" name="check" value="uid" />
<input type="hidden" name="user" value="adam" />
<input type="hidden" name="pass" value="pass1234" />
<input type="hidden" name="profile" value="profile" />
<input type="hidden" name="defaultdatabaseb" value="database" />
<input type="submit" value="submit" />
</form>

Sage Pay form integration encoding

<html>
<form name="pp_form" action="https://test.sagepay.com/Simulator/VSPServerGateway.asp?Service=VendorRegisterTx" method="post">
<input name="VPSProtocol" type="hidden" value=2.23 />
<input name="TxType" type="hidden" value=PAYMENT />
<input name="Vendor" type="hidden" value="myusername" />
<input name="VendorTxCode" type="hidden" value="thevendortxcode" />
<input name="Amount" type="hidden" value="30" />
<input name="Currency" type="hidden" value="GBP" />
<input name="Description" type="hidden" value="Test payment" />
<input name="NotificationURL" type="hidden" value="myurl" />
BillingFirstnames: <input name="BillingFirstnames" type="text" /><br>
BillingSurname: <input name="BillingSurname" type="text" /><br>
BillingAddress1: <input name="BillingAddress1" type="text" /><br>
BillingCity: <input name="BillingCity" type="text" /><br>
BillingPostCode: <input name="BillingPostCode" type="text" /><br>
BillingCountry: <input name="BillingCountry" type="text" /><br>
DeliverySurname: <input name="DeliverySurname" type="text" /><br>
DeliveryFirstnames: <input name="DeliveryFirstnames" type="text" /><br>
DeliveryAddress1: <input name="DeliveryAddress1" type="text" /><br>
DeliveryCity: <input name="DeliveryCity" type="text" /><br>
DeliveryPostCode: <input name="DeliveryPostCode" type="text" /><br>
DeliveryCountry: <input name="DeliveryCountry" type="text" /><br>
<p>Click here to submit
<input type="submit" value="here">
</p>
</form>
</html>
This form currently works using the simulator. Clearly, none of this is being encoded. Firstly, will this work on the test/live environment? Secondly, am I allowed to do it this way and if not, how can I correct it?
Thanks
Alex
It's not going to work. Firstly, the simulator is so far out of date that it doesn't even support protocol 3.00 (earlier ones are deprecated and will cease to function in the live environment from July). Some key features are also missing.
Secondly, you appear to want to use the Server protocol. The registration post for this consists of the values you have above as name-value pairs, posted as the request body to https://test.sagepay.com/gateway/service/vspserver-register.vsp
I recommend having a look at the Server protocol document on sagepay.co.uk - using the simulator isn't going to help.

PHP Form URL vars

I was wondering if it would be possible to have a variable in the URL created when submitting a form?
form:
<form class="register_form" action="action.php" method="get">
Team Name*: <input type="text" name="teamname" required />
Team Region*: <input type="text" name="teamregion" maxlength="4" required />
Team Leader*: <input type="text" name="teamleader" maxlength="16" required />
Team Members: <input type="text" name="teammembers" />
<input name="register_submit" type="submit" value="Register" />
</form>
I'd like the link to end up as: http://.../action.php?do=register
My reasoning for this is so that I can use action.php for more than one thing using if statements. Thanks ^^
Just append the variable you want to the action link.
<form class="register_form" action="action.php?do=register" method="get">
Team Name*: <input type="text" name="teamname" required />
Team Region*: <input type="text" name="teamregion" maxlength="4" required />
Team Leader*: <input type="text" name="teamleader" maxlength="16" required />
Team Members: <input type="text" name="teammembers" />
<input name="register_submit" type="submit" value="Register" />
</form>
Or you can add a hidden field to your form:
<input type="hidden" name="do" value="register" />
Sure, the form action URL can have a query string:
<form class="register_form" action="action.php?do=register" method="POST">
The form data will be sent via POST but do will still be available via GET.
You need to add this to the form
<input type="hidden" name="do" value="register">
Yes, it is possible. You can use any one of following methods
1) You can set the name of your submit button "do"; As the value of your submit button is "Register"
<input type="submit" name="do" value="Register" />
OR
2) You can add a hidden field to your form
<input type="hidden" name="do" value="register" />

WordPress and GET

I'm having form and page(Template Page) in WP. Through form, I want send values GET, then the page create query.
form:
<form id="homepage_form" method="get">
<input type="hidden" name="p" value="48" />
<input class="first" type="text" name="name" />
<input type="text" name="location"/>
<select name="category">
<option value="0" disabled selected>Kategori</option>
</select>
<input class="btn" type="submit" value="Search" />
</form>
First Question. Do I need send id page in form?(input type="hidden" name="p" value="48"). Maybe is other method.
Second Question. When I sent this form, I saw "page_id_48/?location=asdasd". WP stolen second GET (name).
Now I know... I don't like forms in WP or I don't understand.
you need the attribute value , in order to GET it.
<input class="first" type="text" name="name" value="something" />
In WP can't to send get 'name'
<input class="first" type="text" name="name" />
<- bad
<input class="first" type="text" name="notname" /> <- ok

Auto login to Google Analytics?

I have tried following similar steps as mentioned on this Auto login to Google Analytic to impress clients page
<form id="googleanalyticslogin" action="https://www.google.com/accounts/ServiceLoginBoxAuth" method="post">
<input type="text" name="Email" class="gaia le val" id="Email" size="18" value="me#gmail.com" />
<input type="password" name="Passwd" class="gaia le val" id="Passwd" size="18" value="Passw0rd" />
<input type="checkbox" name="PersistentCookie" value="yes" />
<input type="hidden" name="rmShown" value="1" />
<input type="hidden" name="continue" value="http://www.google.com/analytics/home/?et=reset&hl=en-US" />
<input type="hidden" name="service" value="analytics" />
<input type="hidden" name="nui" value="1" />
<input type="hidden" name="hl" value="en-US" />
<input type="hidden" name="GA3T" value="oCGYxIWWGUE" />
<input type="hidden" name="GALX" value="3Jces-nq404" />
<input type="submit" />
</form>
but when I submit form I get Your browser's cookie functionality is turned off. Please turn it on.
Any ideas how to sort it out? Or is there any alternative way to login?
Thank you for your help.
You have to use OAuth to access analytics try taking a look at this
http://code.google.com/p/gapi-google-analytics-php-interface/
that will allow you to not only login but pull analytics straight from the site.

Categories