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.

"posting" to a user profile

Featured Replies

Hello all

 

My next query is regarding user interaction on profile pages.

 

I want to be able to have only logged in users be able to write a comment on someones profile. I dont require the "like" or comment back feature just a simple message. But i dont want none logged in users to be able to leave messages

 

Help or suggestions welcomed.

 

Thanks again

Hello all

 

My next query is regarding user interaction on profile pages.

 

I want to be able to have only logged in users be able to write a comment on someones profile. I dont require the "like" or comment back feature just a simple message. But i dont want none logged in users to be able to leave messages

 

Help or suggestions welcomed.

 

Thanks again

 

 

Couple of ways...

 

1. Prevent the user being able to see the textarea and submit button.

<?php

if (isset($_SESSION['UserID'])) {
    // form goes here
}


?>

 

2. Prevent the user being able to post even if they manage to get around using your form

<?php

if (!isset($_SESSION['UserID'])) {
    header('location: /');
}

?>

 

You'll see it's almost the same code, one checks to see if the user IS logged in, the other checks to see if the user ISN'T logged in.

 

You could also use SQL Joins.

Edited by adamsmith

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.