Good afternoon
My intention is for the customer to enter their phone number in an "editbox", and with a button send the customer to a folder (already created) with their phone number, I've tried and I don't know how to do it.
Thank you
send to a link
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/links.html
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/links.html
-
-
- Posts: 112
- Joined: Sat Apr 25, 2020 5:17 pm
- Contact:
Re: send to a link
There is no standard solution for this, because it's very specific.
But this may work:
1. Create a form with an editbox and submit button
2. Set the action to
3. Add this code to the start of the Page HTML:
Note: I did not try this myselfthis, it is just suggestion. You may need to tweak the code to make it work for you
Or else take a look at the login tools. Which also have a 'redirect' option.
But this may work:
1. Create a form with an editbox and submit button
2. Set the action to
Code: Select all
<?php echo basename(__FILE__); ?>"
Code: Select all
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Get the entered user name from the form
$userName = $_POST['username'];
// Define an array of user names and corresponding folder paths
$userFolders = array(
'user1' => 'path/to/user1/folder',
'user2' => 'path/to/user2/folder',
// Add more user names and folder paths as needed
);
// Check if the entered user name exists in the array
if (array_key_exists($userName, $userFolders)) {
// Redirect the user to the corresponding folder
$folderPath = $userFolders[$userName];
header("Location: $folderPath");
exit;
} else {
// User name not found, redirect back to the form
header("Location: index.html");
exit;
}
}
?>
Or else take a look at the login tools. Which also have a 'redirect' option.
-
-
- Posts: 112
- Joined: Sat Apr 25, 2020 5:17 pm
- Contact:
Re: send to a link
Good morning
It works perfectly, thank you very much.
I'm not a programmer, can it be simplified?
Enter user in "editbox" and send, if user exists, direct to a previously created folder, if that folder does not exist, direct to error page.
Greetings
It works perfectly, thank you very much.
I'm not a programmer, can it be simplified?
Enter user in "editbox" and send, if user exists, direct to a previously created folder, if that folder does not exist, direct to error page.
Greetings
Re: send to a link
If you want different behavior then you will need to update the script yourself. This was just to help you in the right direction.
Unfortunately, I cannot teach you how to program.
Unfortunately, I cannot teach you how to program.
-
-
- Posts: 112
- Joined: Sat Apr 25, 2020 5:17 pm
- Contact:
Re: send to a link
OK, thank you very much for everything
Tnk's
Tnk's