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…
How to make artisan serve work in virtual host?
I’m on Windows 8 and I’m using WAMP to run my laravel project. I have configured apache and I created a virtual host, to access my app through http://myapp.dev. I would like to know if it’s possible …
How to use groupBy() to group a Collection object
My goal is to retrieve all of a user’s ‘items’ and display then in my view grouped by their ‘status’. There are 4 possible statuses, each with their own <div> on the page containing the items’ info. After some poking around I believe I need to use the groupBy() method…
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…
Convert Excel’s “41014” date to actual date in PHP or JavaScript
I’m writing something in PHP/Jquery that allows the user to upload an Excel spreadsheet from Excel. It then takes the data in that spreadsheet and assigns the values from each cell into a variable, but for some reason, I’m having a hard time with dates. Any date in Excel comes in as a number, like…
how get the option value $r[‘id_usr’] of select tag in PHP variable
I need to get the option value of a select tag which is $r[‘usr_id’] when submitted to use that value in php query here is my code :
<…
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"; …
How do I run PHP’s built-in web server in the background?
I’ve written a PHP CLI script that executes on a Continuous Integration environment. One of the things it does is it runs Protractor tests. My plan was to get the built-in PHP 5.4’s built-in web …