View Full Version : Passing Variables with Post Method
MattJakel
07-27-2004, 07:30 PM
I have a script that recieves form data and processes it, passing variables to another script through the URL (like the GET method). The problem is that some of this information is very important and should not be easily edited by someone who understands the variables. I'm currently using the Location:url\n\n header to redirect to the second script. Is it possible to pass information in the same way as the Post method from script to script so that the viewer of my site cannot edit that data?
Thanks,
Matt
Calilo
07-27-2004, 08:33 PM
Well there are several ways.
you can open the second script from the first script (moreless integrate them) and then you can work with the same variables no problem.
you can also instead of just printing the information in the url, for the get method you can crate a page with the information in hidden boxes and make that page post itselft so the information would be transmited to the second script without showing in th location bar. this i think are the easiest ways, but there are plenty more, let me check another mehtod i used a long ago so i can post it correctly here.
oopps forgot... if you want to call the second script to the first one, you just have to write this:
require 'path/script2.cgi';
hope this helps
Calilo
MattJakel
07-28-2004, 02:40 AM
Yes, I thought of using that method with a blank page full of hidden form inputs that automatically submits, but I use workarounds like that all of the time on my site and I'm trying to clean up my code. :) That require command is exactly what I was looking for!
Thanks!
Matt
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.