Redirect to same page, display different content

I’m am in the process of creating a media platform but I’m stuck. I practically have everything working but now I want to do something like Facebook/Instagram/Twitter, where when you log in, you don’t get redirected to a different folder on the server but instead you stay on facebook.com or twitter.com and this time instead of displaying the login form, it now displays the users information.

So what I want to do:
Viewer visits website www.mydomain.com, sees login form
viewer logs in, the domain still remains as www.mydomain.com
now instead of login form, it now displays other content

check login first within your application, display appropriate view/template when not logged in, implement login routine before login check

There is an if operator which one can use to choose between scenarios.

Assuming you have your pages in separate PHP files, something like this will do:

if (whatever condition to see whether a user is authorized) {
    include 'content.php';
} else {
    include 'login.php';
}
1 Like

I tried this but doesn’t work, but anyways thanks for the response guys, I decided to just leave it as is…now my next question is how do I get a specific part of a url? My url is something like:

https://www.mydomain.com/folder1/folder2/folder3/post?token=sERgZluUNT4d9DaxvGcMponW1YBAQyj-

how do I just get token=sERgZluUNT4d9DaxvGcMponW1YBAQyj-

Use $_GET[‘token’] to retrieve the value. I don’t know the context in which you want to use this, though.

Thank you, it worked fantastically :slight_smile:

Is it possible to use FFMPEG with spaces like the example below:

shell_exec("ffmpeg -i .my file name.mp4 -ss 00:00:10.4 -vframes 1 my file name_thumbnail.jpg");

I’m trying to convert files with spaces in between them but ffmpeg doesn’t seem to recognize it…is there a way to do this or no? I’ve done research but I can’t seem to find a correct answer…I’ve even tried the 2 examples below:

shell_exec("ffmpeg -i .my%file%name.mp4 -ss 00:00:10.4 -vframes 1 my%file%name_thumbnail.jpg");

shell_exec("ffmpeg -i .my%20file%20name.mp4 -ss 00:00:10.4 -vframes 1 my%20file%20name_thumbnail.jpg");

have you tried wrapping the file names in ’ ’

God I really love this website and it’s community, worked like a charm again :slight_smile:

A post was split to a new topic: How to alert the user of new posts

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.