Xampp vs apache

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Xampp vs apache

Postby Mr_PieChee » 16. February 2006 21:24

right. i have a very simple if:
if (isset($action) && $action == 'add') {

they i set the value to add, but on xampp it don't work yet on theschool system with have apache configured form the binary file, it works fine.

does any one have any ideas why, or it theres anything i can do to fix it?
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23

Postby Wiedmann » 16. February 2006 22:32

YOu have not an Apache problem, you have a PHP "problem". Please read the manual about "register_globals".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mr_PieChee » 18. February 2006 15:47

so i have to set aciton to somehting else first? that makes no sence to me as its the page name...
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23

Postby Wiedmann » 18. February 2006 18:55

so i have to set aciton to somehting else first?

Please read:
http://de.php.net/manual/en/language.va ... ternal.php
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mr_PieChee » 22. February 2006 13:05

well i'm stumped! i have know idea how to fix it. i want to make the form apear if the link is clicked. its not the editing data that i have a problem with. the form won't show up:

if (isset($action) && $action == 'folder') {
?>
<form name="formfolder" action=" <?php $_SERVER['PHP_SELF']; ?>?do=addfolder" method="post">
<table><tr>
<td>Name of folder:</td><td> <input type="text" name="name" id="createname"></td></tr>
<tr><td>Description of folder: </td><td><input type="text" name="description" id="description" width="100"></td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="createf" value="Create Folder"></td>
</tr></table>
</form>

etc

i just get a blank page, but ht eaddress is right
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23

Postby Wiedmann » 22. February 2006 13:46

I can not see any link or formfield with the name "action" in the HTML part.

if (isset($action) && $action == 'folder') {

So, where did you define the variable $action?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mr_PieChee » 25. February 2006 19:06

arrrr.... i just used a link.. : ie
print '<center>
<a href="admin.php?action=add">Add a Photo</a> :|:
<a href="admin.php?action=edit">Move or Edit a photo</a> :|:
<a href="admin.php?action=folder">Create or remove a folder</a>
</center>';

then if teh varible has been filled in, ie the link clicked, then it works.. but it don't
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23

Postby Wiedmann » 25. February 2006 19:31

You have read the documantation from my link above?

<a href="admin.php?action=add">Add a Photo</a>

A click on a link is a GET-request. So you can refere this variable as $_GET['action'].
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mr_PieChee » 01. March 2006 00:13

ok, but how do i define it? i feeling realy retarded at the mo...

how do i set it equal to part of an address?

do i need to have $_GET['action'] = $action?

or go:
if ($_GET($action) && $action == 'folder') {
?
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23

Postby Wiedmann » 01. March 2006 01:03

ok, but how do i define it?

:?:

You must define nothing...:
1) External GET-variables will not automatically import to the global scope. So you have no $action, but you have $_GET['action'].

Ok, you can assign a external variable to a global one with
Code: Select all
$action = $_GET['action'];

and then work with $action in your code.

2) $_GET is a array like every other array too and you can make the same things with it.

Code: Select all
if (isset($action) && $action == 'folder') {

This should be:
Code: Select all
if (isset($_GET['action']) && ($_GET['action'] == 'folder')) {

You see, no need to import the external variable, you can work diretly with it in this simple case.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mr_PieChee » 02. March 2006 17:08

ok, thanks for your help, i'll have a go now

[edit] god like... it works now.. thanks for all your help, and paitence...
Mr_PieChee
 
Posts: 12
Joined: 30. December 2005 11:23


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 72 guests

cron