How can you make a personal page about every user?PHP [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Yes, i looked for this question online, but I can not understand.
For example i know that when you log in you go to a link like :
site.com/Username
I know that you have to have a page for users in general like : user.php
but how exactly you put the name of the person at the account page when log in or the discription(do you read the name from the url and take other data from the database?).
I am new to php.
Please explain me
-Sorry for my english

The Best Way to do it is make a user.php page and when user login in
saves it's all data in session and when user open his profile/or
something else you can retrive data from session like user id and then
use your query to get the specific data against that user

You can store the username/id in $_SESSION['username'] or $_SESSION['id] like this. And can access the data of the user from the username/id. Hope this might help you.

Related

PHP get twitter username from site visitor [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm not quite sure if this is possible, but I am looking for a way to get the twitter username of a person visiting a website. Does anyone know if there is a way to do this, or if I always need a user to confirm that I am seeing this data?
Preferably I'm looking for a PHP library that I can do this with.
No, that is not possible. Think of the security vulnerabilities: if any website could access your Twitter account information without your permission, then you essentially have no privacy.
You need to use OAuth to first ask the user to sign in. Then, you will have limited access to that user's account information.
Here is a list of PHP libraries to help you do this.

Store retrieved infos from Database in Php session [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I was wondering if it was a good practice to store the infos we retrieved from a DB (more specificaly the user infos) inside a session, useful for the login for example :
e.g :
$sql="SELECT * FROM USER";
$result=$myConnexion->query($sql);
$line=$result->fetch_assoc();
$_SESSION['login']=$line['login'];
$_SESSION['name']=$line['name'];
...
It then would be easier to display infos, welcome messages and so on.
What do you think ?
Thank you for your time
It's perfectly fine. Make sure you only store Public info you might need later on, meaning don't store the password or the user's ID in the db.
Yes, it's fine, as long as you don't store sensitive data, like the password, or the user name. You can check this for more
Using PHP SESSION Variables to store MySQL query results

I want to create a website for polls/survey like this http://www.poll-maker.com/ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
but did not understand
The concept of generating a link &
more importantly how they save the data in database,do they save it like id of poll & yes/no click or done with other logic.
what will happen to the polls which are expired? will they remain in database or somewhere else?
please help
To handle URL you can use cURL.
But I have an easy method. You can use the concept of Query Strings.
To Create New Question
Store the new question in database.Give Each Question a unique ID.
Then After user submits the questions show him a link like:
http://do-survey.com?question=xzxsa
To store polls
Get question like:
if(isset($_GET['question']))
{
$question = $_GET['question'];
// Now you have the question unique id manipulate the database using this
}
this is not the place to ask such questions, but to make my answer at least remotely useful:
they're not generating a link. That link doesn't exist under the form of a file on the server. Take for example a database containing 'id' 'poll' 'var1' 'var2'.
You can make a php page that gets a param from the link, have it like mysite.com/poll?id=1
The php script will get the '1' as a param, then you SELECT * FROM table WHERE id=1 and you generate the contents via php with the data from the DB.

Find user logged php with select from DB [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm doing a website with joomla.
I'm doing a page to insert some data to identify the home of the user logged, and I'd like do another page to modify these data if user need, when he want
Now if I don't want touch joomla login module and I think about a solution but I don't know how do.
Here is what I think to do:
User login into my site
He modifies the data
When the data must update in the DB I'd like to do a think like "update data
Set="$blabla" where id is logged"
How can I do this id=user logged?
You can get the user ID by running the following code:
$user = JFactory::getUser();
$id = $user->get('id');
Source: http://docs.joomla.org/Accessing_the_current_user_object

Login page using Sessions and php and mysql [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
in last days i were working at a script of php where that programme should make me do my job easly . generaly i'm using table 'users' with attributs : id, username, password, fullname, email, tel
i have index.php as the main page of my script or as you can say my dashboard and login.php should be the form page of login where the client or me ^^ entre username and password to login and of cours logout.php for logout and session.php to check if the user is already loged-in also session.php the file who will be included in the header of all my other pages :)
soo i need somebody tell me how to programme a full system of login by seesion and mysql in php, like give me an exemple with the same names of those pages and table.
i hope my explaination is clear and if thiere is any question i'm here
Thanx a lot for help :D
In here, you cant simply ask somebody to tell you how to program a full system, at least spend some of your effort & time to try something first.
Maybe you can have a look at those example 1st.
http://www.makeitsimple.co.in/PHP_loginexmp.php
http://phppot.com/php/php-login-script-with-session/

Categories