Answer the question
In order to leave comments, you need to log in
How to fix the link when sending?
The task is such that users send links of this type
https://site.ru and https://site.ru/ (with a slash at the end of the link) through the form.
Then these links are sent to the database.
Tell me how to make it so that if there is no slash at the end of the link, it is substituted automatically and after that it is only sent to the database
Thanks in advance
Answer the question
In order to leave comments, you need to log in
1. You can type in the terminal:
su user2
chromium-browser
#!/usr/bin
/usr/bin/chromium-browser --user-data-dir="/home/user/chromium2"
[Desktop Entry]
Version=1.0
Terminal=false
Exec=/usr/bin/chromium-browser --user-data-dir="/home/user/chromium2"
Icon=chromium-browser
Type=Application
Categories=Network;
StartupNotify=true
Name=Chrome2
I have 3 such "browsers" done. $url = "https://site.ru";
if ( substr($url, -1) != "/" ) // если последний символ НЕ слеш, то
{
$url.= "/"; // дописываем его
}
echo $url;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question