Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > problems with apache in os x

problems with apache in os x
Thread Tools
Junior Member
Join Date: Oct 2000
Location: Germany
Status: Offline
Reply With Quote
Jun 5, 2004, 03:01 AM
 
hi erveryone,

yesterday i wanted to set up mac os x, php and mysql. i want to run this configuration so my team and i can upload files and project descriptions from university. i wrote a little shell script which always tells my website the dynamic ip that my computer has at the moment.

to this point, everything works awesome. my only problem is i can't pass parameters on my local server. the scripts ran on my remote server, so they must be correct.

here is an example of whta i want to do:

index.php:
<a href="test.php?case=true">TEST</a>

tset.php:
<?php
if ($case=="true") {
echo "hello world";
}
?>

it doesn't recognize the parameter that i pass. does anybody know what this is? maybe a setting in the http.conf file?

best regards
rudy
     
Senior User
Join Date: Jan 2002
Location: Laurentia
Status: Offline
Reply With Quote
Jun 5, 2004, 08:33 AM
 
You are not referencing your passed variables correctly. As of php 4.0 (or something like that), you have to refer to passed variables as $_POST or $_GET (arrays that are predefined for forms (post) or url variables (get). Variables are NOT registered as globals automatically for security reasons.

In your case, I bet if you change:

if ($case=="true")

TO:
if ($_GET['case']=="true")

It'll work.

See the php pages for more help.
     
Junior Member
Join Date: Oct 2000
Location: Germany
Status: Offline
Reply With Quote
Jun 5, 2004, 05:21 PM
 
I did't know that this was new to PHP. In my (older) book this method was tought. I used this method in a lot of my other projects but they all run just perfectly on my remote servers. Do you know how that can be?

Anyways, thanks alot for your help!

rudy
     
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Jun 5, 2004, 08:15 PM
 
Originally posted by rudynorff:
I did't know that this was new to PHP. In my (older) book this method was tought. I used this method in a lot of my other projects but they all run just perfectly on my remote servers. Do you know how that can be?
Alot of shared servers have register globals turned on because alot of scripts still reply on the old insecure methods. You can edit your local php.ini and find `register_globals` and turn it on for your local install to function like the server does.

BTW, you should think about getting away from coding like that, as it is a huge potential security risk. Using the superglobal arrays is not much more difficult.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 04:33 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2