November 10, 200718 yr *looks toward forum PHP gurus* Is this possible? It's a script for visitors to offer feedback, person visits a (sub)domain, and the PHP has a part of the form pre-filled in according to the address they visit. For example, they visit http://feedback.example.com/product-16'>http://feedback.example.com/product-16 and the form already has the product name field filled in with "product-16" (either hidden or shown?) and they can fill out a usual PHP formmail script to send their comments. It would just be one form living at http://feedback.example.com/. How long would that take to build?
November 10, 200718 yr I think you have to go to your host. Mines Fasthost, I just log in there and add a subby. then in the subby page it has a link back to like: first I had: www.mysite.com/blog then I made: blog.mysite.com/ but I can still go to /blog.
November 10, 200718 yr You URL Rewrite to rewrite "http://feedback.example.com/product-16" into "http://feedback.example.com/products.php?product=product-16". RewriteRule ^/([^/]+)(/*)$ product.php?product=$1 I think a rewrite like this should work. (Note: not tested!) Then product.php you can get the product name by using $_GET['product'].
November 10, 200718 yr Author You URL Rewrite to rewrite "http://feedback.example.com/product-16" into "http://feedback.example.com/products.php?product=product-16". RewriteRule ^/([^/]+)(/*)$ product.php?product=$1 I think a rewrite like this should work. (Note: not tested!) Then product.php you can get the product name by using $_GET['product']. Yup, thinking about it I would need apache rewrite, what about the $_GET['product'] - I can't 'do' php would it be as simple as: <input type="hidden" value="<?php echo $_GET['product'] ?>">
November 10, 200718 yr Yup! All though a minor change will ensure it won't add illegal characters to your value attribute: <input type="hidden" value="<?php echo htmlspecialchars($_GET['product']); ?>">
November 10, 200718 yr Author <input type="hidden" value="<?php echo htmlspecialchars($_GET['product']); ?>"> Ta Will have a bash with this, and let you know how it goes.
Create an account or sign in to comment