Skip to content

Equivalent of Alert() and Prompt() in PHP

In JavaScript, we have Alert() and Prompt() which open up a popup box for the user. Is there an equivalent for PHP? $Get_[‘asdf’] is one way to get user input… any others? Also, one more question. Is it a requirement that PHP always be executed all at once? Or can it be like JavaScript, wher…

Lost data because of 301 error (POST)

I’ve a 301 error after doing my POST Form… When I submit my form, I lose all my data and I don’t know why. I search on the net but I don’t understand anything because my english is too bad to do it… My HTML code addSwitchPort.html : My PHP code addSwitchPort.php : This is the cod…

Redirect 302 on Laravel POST request

I’m developing a Laravel Web Service. When I try my POST routes with web forms, everything works fine, but when I try the same with a REST Client like Postman it doesn’t get me the response that should. It gives me status code 302, and redirects to “/”. What’s the problem? Answer…

Visually same string gives different var_dumps in php

UPDATE: Anwer is here PHP unserialize fails with non-encoded characters? I’m trying to match objects with in_array. This works fine except for the object with this string as a property. Visually they are the same, but when I do a var_dump PHP sees different lengths. var_dump results: What can be the cau…

Login Web Page Automatic Logout

I am creating a login page for covering important stuff for only the admin. Here is my current successful code. <?php $username = "adminuser"; $password = "adminpass"; $randomword = "helloworld"; …