wrs
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by wrs
-
-
The problem here is that your eval() statement must be sane PHP.
eval('if ($user == "something") return true; else return false;')
Now your eval statement will return true or false, and can be placed within your if() block.
$o = 'name == bob'; $parts = explode(' ', $o); $user = Array( 'name' => 'bob', ); $str = 'if ($user[\''.$parts[0].'\'] '.$parts[1].' \''.$parts[2].'\') return true; else return false;'; if (eval($str)) echo 'name matches'; else echo 'name does not match';
-
I'll have to assume that this "URL not found /index/contact" error you are receiving is a 404 error generated by your webserver/browser because it was unable to find the file '<documentroot>/index/contact' on disk.
It seems like you have configured your ZF app to handle index/contact correctly, so whats the problem?
Probably, it is because you have not instructed your webserver to 'redirect' all requests to your index.php file where they can be correctly handled by your ZF app.
For apache webservers, you would make use of the mod_rewrite module which allows you to do the above.
In your virtualhost config, or .htaccess, you would want something along the lines of:
RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L]
Basically, this instructs Apache to rewrite all requests which would normally result in a 404 File Not Found back to your index.php for correct handling. There are several ways of doing this, but this is a good starting place.
This is actually covered in the ZF Quickstart Guide
Generate a random String and then concatenate it with another one
in PHP Coding Help
Posted
Not sure what to instruct you to study other than the PHP manual in general
Here is a function for generating random strings:
You would gather this random string and concat it to another with: