Test simple PHP scripts
Posted by: jPaulB (---.cpe.net.cable.rogers.com)
Date: March 07, 2022 02:48PM

Hi Everybody,

I usually want to test my PHP scripts while I am trying to write them. Scripts such as "Mail.php", or "comment.php", "login.php" ... the list is endless. However, so far I need to change the file name to index.php to successfully test.

How can I avoid renaming a script and directly go to a test?

Many Thanks,
Paul

(If I wasn't so stupid, I wouldn't have to be so persistent)

Options: ReplyQuote
Re: Test simple PHP scripts
Posted by: Otomatic (Moderator)
Date: March 07, 2022 03:18PM

Hi,

To check the functioning of php scripts like 'http://localhost/myscript.php' presupposes that the script is in the wamp(64)/www/ folder which is not recommended, this folder being reserved to Wampserver itself and being able to be modified at the time of updates.

It is recommended to create its own folder, for example wamp(64)/www/test/ to put the various PHP scripts like mail.php, comment.php or login.php.

Then, these different scripts can be launched by :
'http://localhost/test/mail.php'
or
'http://localhost/test/comment.php'
or
'http://localhost/test/login.php'

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Test simple PHP scripts
Posted by: jPaulB (---.cpe.net.cable.rogers.com)
Date: March 08, 2022 01:26AM

Thank you Otomatic.

That's exactly what I needed.

Many Thanks,
Paul

(If I wasn't so stupid, I wouldn't have to be so persistent)

Options: ReplyQuote


Sorry, only registered users may post in this forum.