PDA

View Full Version : Php variable passing



grandsp5
August 27th, 2003, 01:27 PM
http://members.lycos.co.uk/grandsp5/

This is a direct upload of Jubba's tutorial onto a website but for some reason it doesnt work. I enabled php but it doesnt recieve the variables for some reason. This is what I uploaded

Digitalosophy
August 27th, 2003, 09:58 PM
he, this used to drive me crazy


$name = $_POST['name'];


Reason is because your php.ini file has Global variables turned off.
So you will need to use that syntax when passing variables

grandsp5
August 28th, 2003, 02:31 AM
thats the syntax I have right now...isnt it? This is my very first time with php so if I am doing something dumb please let me know.

Digitalosophy
August 28th, 2003, 09:23 AM
o wow sry it is, try using GET

grandsp5
August 28th, 2003, 12:27 PM
ok will do

grandsp5
August 28th, 2003, 12:33 PM
ok dig, using GET fixed it but can you explain why? I don't know the differences between get and POST, all I know is they are a variable passing method.

Jubba
August 28th, 2003, 03:48 PM
$_GET[] is used when you send the variable thru the URL string like this:

http://www.mywebsite.com/index.php?myVariable=27

$_POST[] is used when you don't send variables thru the URL string

post is more secure

grandsp5
August 28th, 2003, 03:52 PM
right but how come your tutorial didnt work when I used post? I uploaded what you had to a site and it didnt work until I changed post to get. I just unzipped your file from the tutorial part one and uploaded it. I will try again to see if I made a dumb mistake.

Jubba
August 28th, 2003, 03:53 PM
probably a problem with the Flash file. I'm not sure. Its been a while. I'll take a look at the files later this week.

grandsp5
August 28th, 2003, 03:58 PM
Ok. Thanks for all of your help :)

Digitalosophy
August 28th, 2003, 04:00 PM
Jubba some servers don't allow POST, why? I have no idea. But i just did some server side code for someone and i had to use GET

grandsp5
August 28th, 2003, 04:03 PM
Well the weird thing is when I try the mail script, it works with both POST and GET so I'm pretty sure it allows POST. This is tripod.lycos.uk btw.

Digitalosophy
August 28th, 2003, 04:07 PM
Well I never used lycos so I really can't say for sure. I am taking it that that is a free host, so with server's that are free, nothing ever works the way it is supposed to

grandsp5
August 28th, 2003, 04:10 PM
very possible. Maybe its just a bug.?? Know of any other free servers that support PHP? I don't want to waste money paying for my experiments in PHP...

Digitalosophy
August 28th, 2003, 04:12 PM
yea your own pc *laughs* :)

download php and mySQL and install it on your machine to learn how it really works. you will also need IIS

really you should, it will help you out a lot

grandsp5
August 28th, 2003, 04:15 PM
I tried easy PHP but I can't figure out how to make it work...

and IIS?

Digitalosophy
August 28th, 2003, 04:18 PM
Internet Information Systems

http://www.kirupaforum.com/forums/showthread.php?threadid=27549&highlight=IIS

Bunch of stuff there on how to install it. It's on your windows CD

grandsp5
August 28th, 2003, 04:26 PM
Hmm, I got the administrator tools panel open in the start menu but IIS isnt there

Digitalosophy
August 28th, 2003, 04:36 PM
Properties >> advanced >> show admin tools

grandsp5
August 28th, 2003, 04:41 PM
I got that far. The Admin Tools panel is open but there is no IIS option.

Digitalosophy
August 28th, 2003, 04:52 PM
well cuz you don't have it installed. get your windows cd and go to install windows components

abzoid
August 28th, 2003, 05:40 PM
I'm not sure if this applies in this case, but there have been a couple of times that Rev and I have had "issues" using POST to send variables from a Flash movie when the user was on a Mac. I'm not sure if Macromedia has completely resolved this problem or not. We've just gotten in the habit of using GET to avoid the issue entirely.

We now return you to your regularly scheduled programming :P

grandsp5
August 28th, 2003, 06:39 PM
Got it working. I installed easyPHP and worked from there. Thanks for all of your help everyone, you made my first venture into PHP a little less painful :)

Digitalosophy
August 28th, 2003, 06:50 PM
iight kool :)

Jubba
August 28th, 2003, 11:31 PM
I'm not really sure but that could lead to a HUGE security problem with sending prices and stuff like that with GET... If your host doesn't allow POST then find out why they don't and tell them that they better get their act together...

grandsp5
August 28th, 2003, 11:46 PM
I fixed my problem Jubba. It works both ways with easyPHP on my computer but when I upload the same script it doesnt work. Something on their side not mine.

Digitalosophy
August 29th, 2003, 01:55 AM
Originally posted by Jubba
I'm not really sure but that could lead to a HUGE security problem with sending prices and stuff like that with GET... If your host doesn't allow POST then find out why they don't and tell them that they better get their act together...

Check this out. I did the server side coding for www.sneakerstyles.com . It is hosted on Ipower, which I'm sure you know I use for my web space as well. When I used POST I got an error saying that the POST method wasn't allowed on the server. Now I found that extremly strange and meant to ask you about but I kinda forgot. Cuz I use POST for everything on my server, and it's the same company. Why would they disable POST?

rysolag
August 29th, 2003, 04:09 AM
what versions of PHP and mySQL are the best to download for use on your own computer?

grandsp5
August 29th, 2003, 12:22 PM
i used easyPHP which is very straightforward. download and install, install the english pages (unless you speak french), then start the program. Place files in the programfiles/easyphp/www directory and type localhost into your browser (delete the index file in www first) and a directory should come up. click on the files and you are ready to go.

rysolag
August 29th, 2003, 09:20 PM
where are the english versions?

Scootman
August 29th, 2003, 10:59 PM
oops sorry got confused nevermind

grandsp5
August 30th, 2003, 12:31 AM
on the download page there should be some files that say english versions