473,507 Members | 6,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I check post and get method at once

250 Contributor
In my web page I want to check post and get method at once. This is my code. But this code is not working.."GET" recives data from ajax page and "POST" receives data from same php page.

Expand|Select|Wrap|Line Numbers
  1. if((isset($_GET['S'])==1) && (isset($_POST['Submit'])))
  2. echo "test";
  3. }
  4.  
Aug 25 '11 #1
3 2019
johny10151981
1,059 Top Contributor
Yes you can
PHP allow it very well
Aug 25 '11 #2
yyuuvvii
5 New Member
Expand|Select|Wrap|Line Numbers
  1. if((isset($_GET['S'])==1) or (isset($_POST['Submit'])))
  2. echo "test";
  3. }
or you can also use
Expand|Select|Wrap|Line Numbers
  1. if((isset($_REQUEST['S'])==1) && (isset($_REQUEST['Submit'])))
  2. echo "test";
  3. }
Aug 25 '11 #3
vijith vijayan
5 New Member
u r using ajax pages,hence there may be page refreshing issues,so i think you cant get the values properly,just echo 'S' and 'Submit' as

Expand|Select|Wrap|Line Numbers
  1. $ss=$_GET['S']);
  2. $su=$_POST['Submit']);
  3.  
  4. echo $ss;//may be incorrect
  5. echo $su;//may be correct
  6.  
and find the error youself...also try with REQUEST[] hence more ajax pages deals with this...if not possible try with $_SESSION[] to data transfer and check as
Expand|Select|Wrap|Line Numbers
  1. if((isset($_SESSION['S'])==1)&&$SESSION['S']!=''))...
after your codes,set
Expand|Select|Wrap|Line Numbers
  1.  $_SESSION['S']='';
its not a secure method...before 2 days i solve such kind of an issue like this
Aug 26 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5306
by: Angie | last post by:
Hello everybody, I have an osCommerce shopping cart on my site, which is an open-source product that uses php. I'm very new to php. I also have an online scheduling application that I outsourced...
4
3548
by: mickbw | last post by:
I am unable to display PHP pages generated by a submission of a form using a POST method. To illustrate this, I created a very simple form called TestForm.php . <!DOCTYPE html PUBLIC...
9
80975
by: FF | last post by:
Hello I would like send variable to php script from URL using POST method. Is possible do it ? ( <a href="xxx.php">) thanks for your help FF
15
3104
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
2
1907
by: Asp Help | last post by:
I'm working on a ASP applicatition to create Windows 2000 users. Because I don't want everybody to have access to the site I've changed te security in IIS 5.0 which runs on a windows 2000 Sp4...
4
2939
by: VB Programmer | last post by:
Can someone provide a simple explanation on the difference between the GET and POST methods? What are the adv/disadv of both and when should I use them? Thanks.
9
2108
by: WJ | last post by:
I have an Asp.Net page that redirects the user to another page with a piece of data to be passed. Below is the c# instruction: Response.Redirect("mySpecialPage.aspx?go1="+strGoName); This will...
5
3012
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
8
2091
by: MARTIN LANNY | last post by:
Hi everyone, I am having a real trouble to figure out how to amend this code to switch from GET to POST method. -------------------------------------------------------- Public Function...
6
29723
by: rpcchandu | last post by:
Hi Coders, I have to redirect from my server to the different server page by simulating the POST method submit from the Controller file, I tried using post_via_redirect, but could not succeed......
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.