Is it possible to use $_POST from an anchor? [duplicate] - php

This question already has answers here:
How do you force a web browser to use POST when getting a url?
(11 answers)
Closed 8 years ago.
I'm working on a retail type website and I have the search bar so that when you search for something it shows up in a grid with all the results. Now, all the product names are going to be links that all lead to the same page (result.php) which is full of variables which are filled with the information of the product that was clicked. How would I go about doing something similar to
$name = $_POST['productname'];
but with an anchor tag instead of a text input so I can use it to pull the MySQL data to fill in the page. Is something like this possible?

Click
if(isset($_GET['variablename'])) {
echo $_GET['variablename'];
}
if you use query string in anchor tag you cannot use $_POST.

Related

My form element disappears when id="..." is added to the tag [duplicate]

This question already has answers here:
AdBlock plus hids elements with ids or class with the word "ad"
(2 answers)
Closed 3 years ago.
As per the title, )I have a form that needs and id beacuse of the textarea element. However, just adding the id makes the form disappear completely.
Code before disappearance:
View before disappearance:
Code when id is added:
Refreshed page:
Does anyone have a clue? I don't even know where to start looking for a solution, this seems so ridiculous. The newAd is unique id within the scope of the project, not just the page, and is only referenced in code within textarea's form attribute.
Your ad blocker is likely causing the issue, since the id contains the word ad.
See this Q/A - AdBlock plus hids elements with ids or class with the word "ad"

get data from URL without having variables [duplicate]

This question already has answers here:
Get the full URL in PHP
(27 answers)
Closed 7 years ago.
I don't know how can I get data from an url without having any sort of variable.
For example if the user comes to the website welcome.com and he starts adding to the url
EX: welcome.com/NewYork-NY/Driver
how can I save NewYork-NY and Driver when he/she hits enter ?
I need to save the data in order to list some content for the user and the only option for him to get to this content is if he goes to that URL manually, there is no button or option for him to chose between cities or categories.
The superglobal $_SERVER['PATH_INFO'] contains all the parts of the URL path after the script. So if the user goes to:
welcom.com/index.php/NewYork-NY/Driver
$_SERVER['PATH_INFO'] will contain /NewYork-NY/Driver.

How to get the data from input without attribute name? [duplicate]

This question already has answers here:
Does form data still transfer if the input tag has no name?
(3 answers)
Closed 9 years ago.
I read $_POST is empty after form submission topic and I wondered how to get the data from input without attribute name?
<input type="text" >
var_dump($_REQUEST)//empty
var_dump(file_get_contents('php://input')) //empty
Basically, the form should be specified its name. If not, you cannot get it from the server-side.
However, the form without name is also valid in HTML5. The reason is that you might sometimes want to use for form submission via AJAX or Javascript app. In many cases

get selected content from ajax search result [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
adding content from search result with jquery
I'm using this nice script http://qpoit.com/marcofolio_demo/apple_search/ however I want to display the selected value in a div with $.("#result").html(selectedValue); but I don't know how to get the selected value after the search results appear. Please help
If you want to display the text for the search result which appears in the <span> tag:
// Place inside the keyup method used for triggering AJAX call
$('#searchresults a').mouseenter(function() {
$('#result').text($(this).children('.searchheading').text());
}).mouseleave(function() {
$('#result').text('');
});

Simplest way to update website content without editing the page [duplicate]

This question already has answers here:
How do I make a div element editable (like a textarea when I click it)?
(8 answers)
Closed 8 years ago.
I've built a website for a friend and because he is not very techy and will be updating it relatively often.
My question is is there a way I can update the site using say, a PHP form and that will write a new div into the page?
So in standard english it would be the following:
Enter title
Enter date
Enter poster
Enter content
Submit
Can I do that simply in PHP? I'm open to other suggestions as well.
Thanks a lot!
Liam
I highly suggest you "Inplace Editing"
http://www.appelsiini.net/projects/jeditable
http://code.google.com/p/jquery-in-place-editor/
https://stackoverflow.com/questions/708801/whats-the-best-edit-in-place-plugin-for-jquery
The user has only to point and click on elements which he want to change. Plain simple... It's on you to implement an basic authentication system so that only the Owner of the Page is allowed to edit and save Data.
All in all it's just the editing of a file. You can write a php script that takes that input from the user and basically rewrites the html page accordingly.

Categories