Hide url parameters in php - 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>

Related

why my forms are not working in bootstrap website?

I tried all but no form is working with method or simple action like http://google.com `
<form action="http://google.com" method="post">
<input type="text" />
<input type="submit" />
</form>
even this is not working
use this
<form role="form" action="http://google.com" method="post">
<input type="text" name="text" />
<input type="submit" name="submit" />
</form>
role attribute for FORM
name attribute for input
In PHP, $_POST always accept name attribute from form elements:-
You need to write
<input type="text" name='name_of_your_field' />
instead of
<input type="text" />
You need to refer this Link.

My PHP form is clearing the $_GET parameters in my URL

By default, when you visit this page $_GET['page'] is set to 1. I have a search box that allows users to search the same page using $_GET['search'] as the search parameter; however it clears the $_GET['page'] parameter.
Is there a way I can make both parameters stay in the URL when using the search box?
Here's my code:
Search Form:
<form action="page.php?page=1" method="get">
<input type="text" placeholder="Search" name="search" />
</form>
page.php:
<?php
if (isset($_GET['search']) && isset($_GET['page'])) {
// My query goes here
}
?>
Pass the page parameter in as a hidden HTML field.
<form action="page.php" method="get">
<input type="text" placeholder="Search" name="search" />
<input type="hidden" name="page" value="1" />
</form>
In your search form you need a button and you can add an input type hidden and print in his value your $_GET['page'], like this :
<form action="page.php" method="get">
<input type="text" placeholder="Search" name="search" />
<input type="hidden" name="page" value="<?php echo $_GET['page']; ?>" />
<input name="btn" type="submit" value="Send" />
</form>

How do I send inputs as well as xml to a url for response?

Unfortunately I can't share public details of the service (and even if I, it is very little known, so doesn't matter).
I am getting a problem with sending xml data along with input fields over http ? I guess this is a noob question, but I am really not able to figure out.
There is an xml with fields and there are input fields which I have to send over http. Here are input fields:
<input type="hidden" name="RESPONSE_URL"
value="http://XXXX/" />
<input type="hidden"
name="PARTNER_CODE" value="TRTRTRABTEST" />
<input type="hidden"
name="QUOTE_ID" value="123456789012345" />
Any pointer to a tutorial along with your negative vote will be thankful.
//Your XML data in a string
<FORM action="PAGE YOU WANT TO SEND DATA" method="post">
<P>
<input type="hidden" name="RESPONSE_URL"
value="http://XXXX/" />
<input type="hidden"
name="xml_data" value="<?php echo $xml_data; ?>" />
<input type="hidden"
name="QUOTE_ID" value="123456789012345" />
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>
You need to post the data.
Check out http://www.w3schools.com/tags/att_form_method.asp

2 Forms in a page, Get the Value from the other form

I have 2 HTML form in a page
<form action="my-page.php" method="post" id="savedata" name="savedata">
<input class="text" name="myname" value="" type="text" />
<input class="text" name="myaddress" value="" type="text" />
<input type="submit" value="Save" />
</form>
<form action="my-page.php" method="post" id="previewdata" name="previewdata">
<input type="submit" value="Preview" />
</form>
The first one [savedata] will save the data to MySQL after clicking the [Save Button]
The second one [previewdata] will preview (means will just show in the page using HTML) the data once the [Preview Button] was clicked
How can the 2nd form get the data from the 1st form?
As an alternative to using 2 different forms you could have a single form with 2 submit buttons:
<form action="my-page.php" method="post">
<input class="text" name="myname" value="" type="text" />
<button type="submit" name="action" value="save">Save</button>
<button type="submit" name="action" value="preview">Preview</button>
</form>
Now inside your server side script look for $_POST["action"] and act accordingly.
Also in HTML5 there's the formaction attribute that could be specified on a submit button to invoke a different server side script.

pass data from a form to a different page

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']

Categories