XAMPP 1.7.4 doesn't work well.

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

Re: XAMPP 1.7.4 doesn't work well.

Postby ulisse » 01. February 2011 16:07

I'm a newby foe xampp.
I was working with its to use joomla.
With 1.74 is impossible for a lot of error when you istall mysql database. so for joomla it's preferred to use 1.73 version.
You should write this in faq for xampp if you can.

another:

when you have services like iis installed, apache doesn't run and you don't have any messages. So isn't true this:

http://www.apachefriends.org/en/faq-xam ... ml#nostart - The apache does not start on my system!!!, n.1, but only you have only that apache doesn't run.

thanks

ciao

u
ulisse
 
Posts: 1
Joined: 01. February 2011 15:58

Re: XAMPP 1.7.4 doesn't work well.

Postby simon_a6 » 01. February 2011 16:11

I did once get Apache and IIS to run on Vista at the same time.
I've no idea how I did it now. But was XAMPP running apache, and Windows running IIS.

I still have people telling me my code was wrong. Odd really, when 1.7.3 never brought them up.
simon_a6
 
Posts: 4
Joined: 01. February 2011 12:27

Re: XAMPP 1.7.4 doesn't work well.

Postby RossK » 19. February 2011 03:00

I upgraded from XP Pro to Windows 7 changed from Apache server to XAMPP Server
Code worked with no errors with Apache on XP machine prior to upgrade

Error Message:
Notice: Undefined index: injury_type in C:\xampp\htdocs\victim19b.php on line 73

Same error message for all the $_POST in the code

Code
Line 6 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST">
Line 54 <select name="injury_type">
Line 55 <option value ="Trauma" > Trauma</option>
Line 55 <option value ="Trauma & Medical" > Trauma & Medical</option></select><br>
Line 73 $injury_type=$_POST["injury_type"]; //input injury type

Note I tired "injury_type " and 'injury_type' using double quotes " " or single quotes' ' get the same error

Where can I get information on XAMPP error messages or has anyone seen this error
RossK
 
Posts: 2
Joined: 19. February 2011 02:25

Re: XAMPP 1.7.4 doesn't work well.

Postby WilliL » 19. February 2011 18:35

hi RossK,

this is not a problem of XAMPP, it's a problem of code, when you use PHP_SELF and some variables aren't declared..
Its a NOTICE, not an error ;)

On first call, there is no $_POST arry.

~E_NOTICE means: don't show notice ...

In XAMPP 1.7.3, php.ini -> error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED // you will not see a notice or used deprecated functions of php
In XAMPP 1.7.4, php.ini -> error_reporting = E_ALL | E_STRICT // you see all error, OMO the better way

You can extend your code by another check like
Code: Select all
if (isset($_POST["injury_type"])) {
    your code
} else {
  initialize variables
}
...

html form


btw I would spread the script in differnet parts: htmlpart.php validatepart.php
submit in htmlpart.php will call validatepart.php
validatepart.php will include( htmlpart.php) if neccessary
Willi
WilliL
 
Posts: 661
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: XAMPP 1.7.4 doesn't work well.

Postby RossK » 19. February 2011 20:35

Thanks for the quick response

Just so I understand correctly I need to have a the following code for each of the POST or GETS I have in the code..


if (isset($_POST["injury_type"])) {
your code
} else {
initialize variables
}
...

I am very new to coding- this was my first program- It is very flat all code is in one file. Future versions should put code in different files.

Since I am new to coding I do not have any bad programming habits I also do not have any good programming habits...

RossK
RossK
 
Posts: 2
Joined: 19. February 2011 02:25

Re: XAMPP 1.7.4 doesn't work well.

Postby WilliL » 20. February 2011 13:30

not every variable, you have to check: is it the first time, your script is called and in this case you have to define/initialize the variables :!:

Code: Select all
.. script ..
if (!isset($_POST['submit']))  {  // on first call submit button can't be pressed
    .. initialize variables, used in html form ..
} else {
    .. current script ..
}
.. html form ..
Variable should be declared/initialized before use, or you'll get an E_NOTICE, if activated in error_reporting.

on my experiences you'll get a horrible script for later redesign ;),
it'll grow and grow .. at last you have to rewrite it to get it well-arranged.

hint: $_SERVER['PHP_SELF'] can be corrupted - possible security hole - have a search in i-net.

Code: Select all
// my preference, you don't have a compicate firstcall check
// startscript.php
<?php
     $action_tag = "http://localhost/anotherscript.php";
//     if (!isset($include_it)){                             // only needed, if anotherscript.php will include startscript.php
          $var1 = 'initial';
          $var2 = 'initial';
//     }                                                     // only needed, if anotherscript.php will include startscript.php
?>
... html ...
<form action=<?php echo $action_tag; ?>  method="POST">;
... html ...
Willi
WilliL
 
Posts: 661
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests