php problems with XAMPP

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

php problems with XAMPP

Postby nigele2 » 01. November 2009 20:05

Hi I've installed XAMPP on Windows Vista (see details below) a few days ago and everything worked like a dream. But I then tried simply passing variables on a url to a php file and had no luck. I followed dozens of tutorials and formats but always a null value was passed. The basic code is as follows:

The link in my html file:
Code: Select all
<a target="frameleft" href="listscripts.php?filename=runout">Admin</a>


My php:
Code: Select all
<?php
echo (':');
echo ( $_GET['filename']);                 
echo (':');

I've tried every combination of formats including a simple $filename and $_GET['$filename']) and many others but always a null value.

Now I can believe it is my coding but I note on the web various reports of issues and fixes that relate to this kind of behaviour. If someone could assure me it is me being stupid and not a need for a patch or a complex set up issue I would be most grateful.

###### Apache Friends XAMPP (Basis Package) version 1.7.2 ######
+ Apache 2.2.12 (IPV6 enabled)
+ MySQL 5.1.37 (Community Server) with PBXT engine 1.0.08-rc
+ PHP 5.3.0 + PEAR (PEAR, Mail_Mime, MDB2, Zend)
+ Perl 5.10.0 (Bundle::Apache2, Bundle::Apache::ASP, Bundle::Email, Bundle::DBD::mysql, DBD::SQlite)
+ XAMPP Control Version 2.5.8 (ApacheFriends Edition)
+ XAMPP CLI Bundle 1.6
+ XAMPP Port Check 1.4
+ XAMPP Security 1.1
+ SQLite 2.8.17
+ SQLite 3.6.16
+ OpenSSL 0.9.8k
+ phpMyAdmin 3.2.0.1
+ ADOdb v5.09a
+ FPDF v1.6
+ Zend Framework 1.9 Minimal Package (via PEAR)
+ Mercury Mail Transport System v4.62
+ msmtp 1.4.17 (a sendmail compatible SMTP client)
+ FileZilla FTP Server 0.9.32
+ Webalizer 2.21-02 (with GeoIP lite)
+ Xdebug 2.0.5 for PHP
+ eAccelerator 0.9.6-rc1 for PHP
+ Ming 0.4.2 for PHP
+ PDF with pdflib lite v7.0.4p4 for PHP
nigele2
 
Posts: 11
Joined: 01. November 2009 19:46

Re: php problems with XAMPP

Postby Izzy » 01. November 2009 22:21

Is this a typo perhaps?
My php code:

<?php
echo (':');
echo ( $_GET['filename']);
echo (':');
?>
If not a typo then there is a missing closing tag, in red, that should be added to your code.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: php problems with XAMPP

Postby nigele2 » 01. November 2009 23:19

Izzy no typo. The block looks like this and everything works except the variable being null.

Code: Select all
<?php
echo (':');
echo ( $_GET['$filename']);
echo (':');
$handle = fopen('runout.txt', 'r');
$file = file_get_contents('runout.txt');
echo ($file);
fclose($handle);
?>


I'm at a total loss so any ideas very welcome
nigele2
 
Posts: 11
Joined: 01. November 2009 19:46

Re: php problems with XAMPP

Postby Izzy » 02. November 2009 09:51

When posting on these forums for support it helps if you include all the details of your issue correctly so an effective troubleshooting process can be implemented with minimal time waisting.


Tested your code with the following positive result.

1. I created a html file called admin.html and pasted your anchor code.

2. I created a file listscripts.php with your php code exactly as you posted it.

3. I created a text file with a list of text and named it runout.txt

4. I saved the 3 files into the C:\xampp\htdocs folder.

5. After starting the Apache server in XAMPP I called the admin.html file:
http://localhost/admin.html

6. I was given the Admin link which after clicking I was given the list of text I had placed in the runout.txt file with the address http://localhost/listscripts.php?filename=runout in my browser's address bar.

This was all carried on an XP PC using an 'out of the box' XAMPP 1.7.2 installation - no configuration changes at all.

Clear your browser's cache perhaps.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: php problems with XAMPP

Postby nigele2 » 02. November 2009 11:01

Izzy my apologies for miss understanding this forum. I had not wanted to trouble anyone with code debugging but was simply concerned that this issue may relate to a set up or bug issue having seen reference to such on the net. I would have been happy if someone had simply said they had the same issue or - by an absence of response - they indicated they hadn't.

However thank you for your effort in reproducing the problem; it is much appreciated. I guess it (and the lack of other replies) clearly illustrates a set up issue . On that basis I will proceed in two directions:

1. I will load as far as possible the same system on UBUNTU and try to reproduce the problem.
2. I will check the system files, ini's and conf's along the lines of those who had similar problems in 2006 (being wary as 3 years have passed).

Hopefully I'll be able to post a solution here very soon.
nigele2
 
Posts: 11
Joined: 01. November 2009 19:46

Re: php problems with XAMPP

Postby nigele2 » 02. November 2009 15:42

Problem gone away :D - I would say solved but I don't know why.

Tried a linux load of XAMPP and it worked fine. So I cleared down my windows implementation, I took a windows upgrade to Vista, I removed two other software products that should have had no impact. I then reloaded XAMPP, I checked the ini's etc but decided not to change anything, loaded my html, php stuff and I now have success.

Could I have screwed something up? YES! So thanks for your interest Izzy and anyone who was passing. If I get it again I'll come back here of course.
nigele2
 
Posts: 11
Joined: 01. November 2009 19:46


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 40 guests