Skip to content

Tag: php

store constant variable on server via .htaccess

I would like to store the INDEX_URL constant the easiest way possible. There is a developer site and a normal site. If there is any change on the developer site, I would like to just copy the entire files but this constant is not the same on the 2 sites. I have made this test: It seems it does not

select max codeigniter

Im trying to get an max value with codeigniter from an table but it isnt working. This is the error i get: Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string Filename: database/DB_active_rec.php Line Number: 427 This is my function: What im trying to do is as followed:…

Capturing and displaying exec/shell_exec periodic output?

You can easily use exec() or shell_exec() to execute a system command, like ls -l /var/www/mysite and then output the result of the command. How would one execute and display the result of a command that periodically prints information out to the console? You have a simply Python script. If you run the script…

PHP “php://input” vs $_POST

I have been directed to use the method php://input instead of $_POST when interacting with Ajax requests from JQuery. What I do not understand is the benefits of using this vs the global method of $_POST or $_GET. Answer The reason is that php://input returns all the raw data after the HTTP-headers of the req…

Change Form Elements Depending On Selected Option

I have seen several sites where there is a form, starting with a dropdown box, and depending on the box chosen there is different form elements, for example, let’s say I wanted to make an uploader script, the dropdown box might hold: And is Upload is selected I would want a browse file element, while wi…