Hack Forums
[PHP] [SOLVED] PHP code on XAMPP localhost server - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] [SOLVED] PHP code on XAMPP localhost server (/showthread.php?tid=5755555)



[SOLVED] PHP code on XAMPP localhost server - v47093 - Nov 20, 2017

Hi, there.

'echo' command is not returning anything 
-I m using xampp
-my pc as server\\
-Using HTML code to view in web page
-Everything works fine , except messages under echo do not show up as it expected to be.


Have a look :
https://pastebin.com/aNLPbViW

If u have any suggestion, please post reply.


RE: PHP code on XAMPP localhost server - Silver Haz3 - Nov 20, 2017

Are you 100% sure your PHP is Running ?


RE: PHP code on XAMPP localhost server - v47093 - Nov 20, 2017

(Nov 20, 2017 06:03 AM)SilverHaz3 Wrote:  Are you 100% sure your PHP is Running ?

Tried running them through online compilers, shows unknown undefined mysqli_connect error    
Which is acceptable. Rest is fine
As for now, I m still stuck mate :/


RE: PHP code on XAMPP localhost server - fx bg - Nov 20, 2017

your preg_match needs to be changed (since it returns an int and not a bool)
Code
if (preg_match('/[A-Za-z0-9]/', $password) != 1) {



RE: PHP code on XAMPP localhost server - V3t3r4n - Nov 20, 2017

My guess (I haven't looked at your code) would be that your php is throwing some sort of Fatal Error and you don't have error reporting on, so you don't see anything happening.

Add these 2  lines at the beggining of your php tag:


PHP Code

<?php 
error_reporting
(E_ALL);
ini_set('display_errors', 1); 


And try running it again, and see if something shows up :)


RE: PHP code on XAMPP localhost server - Elite Hacker 69 - Nov 20, 2017

which echo isn't working?


RE: PHP code on XAMPP localhost server - Squito - Nov 21, 2017

Potential issues:
1. The extension of the file is not .php (but I guess this is not the case, because the echo wouldn't be processed either)
2. You are using an outdated PHP version, which is under 5.5
3. Mysqli is not a loaded extension
Without the actual error message(s) I'm just guessing.


RE: PHP code on XAMPP localhost server - v47093 - Nov 21, 2017

Solved guys.
It was just the mismatched variable name