Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Guru?

Featured Replies

*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? :)

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.

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'].

  • 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 :huh:

 

would it be as simple as:

 

<input type="hidden" value="<?php echo $_GET['product'] ?>">

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']); ?>">

  • Author
<input type="hidden" value="<?php echo htmlspecialchars($_GET['product']); ?>">

 

Ta :) Will have a bash with this, and let you know how it goes. :good:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.