Is it possible to auto-fill a text file on a page via visiting the URL directly and by adding a query to the URL?
Say by visiting account login page at:
site.com/index.php?route=account/login
Can I add a query to URL to fill in the email-address field?
I was thinking maybe changing the URL to something like this:
site.com/index.php?route=account/login?email=Auto-Fill-Email-Field@gmail
How can I make this work?
.
That would then be:supak111 wrote: ↑Fri Feb 21, 2025 11:16 amIs it possible to auto-fill a text file on a page via visiting the URL directly and by adding a query to the URL?
Say by visiting account login page at:
site.com/index.php?route=account/login
Can I add a query to URL to fill in the email-address field?
I was thinking maybe changing the URL to something like this:
site.com/index.php?route=account/login?email=Auto-Fill-Email-Field@gmail
How can I make this work?
.
site.com/index.php?route=account/login&email=Auto-Fill-Email-Field@gmail
Yes.
You need some code on the page that detects if those URL variables are set and then sets the value attribute of the inputs to it.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Ok thanks guys, got it to work ツ
In theme view change:
TO:
In the controller file add this to in "public function index() {"
In theme view change:
Code: Select all
<input type="text" name="email" value="" required="required" id="emailField" class="form-control" />
Code: Select all
<input type="text" name="email" value="{{ email|e }}" required="required" id="emailField" class="form-control" />
In the controller file add this to in "public function index() {"
Code: Select all
// Check if 'email' exists in the GET request
$email = isset($this->request->get['email']) ? $this->request->get['email'] : '';
// Pass to the Twig template
$data['email'] = $email;
~ OC 3.0.3.2 and OCmods only ~
Who is online
Users browsing this forum: paola_84 and 16 guests