Global Autoloading in PHP:
-------------------
Some time you me require few files to be automatically loaded in such a case it becomes very hactric in that case Why not to make your own autoloader and let autoloader include all the files anywhere
Make a file init.php
<?php
$autoload=['errors','functions'];
foreach($autoload as $index => $value)
{
include "{$value}.php";
}
In Root Folder Place .htaccess file
RewriteEngine On
php_value auto_prepend_file 'init.php'
Note : init.php must exist
File name can be Anything Whenever
How to get and set form values
---------------------
Input textbox or <Input> Use
How to get:
<form action="somepage" method="GET/POST">
use name Attribute to get the value
<input type="text" name="xyz-name"/>
</form>
How to set value on Input box
you can value attribute
$name ='ravi';
I want to put this value by default in Text Box
1. <input type ="text" name="name" value="ravi">
for dynamic
<input type="text" name="name" value="<?php echo $name; ?>">
If any Error is raised it will be visible on the page
in Control + U view page source.
0 Comments