a246530
-
Posts
2 -
Joined
-
Last visited
Posts posted by a246530
-
-
Hey guys,
I am fairly new to php and have been working on a project for about a week. I am currently running all of my queries and all of my events inside of my site. When i submit a form it checks for isset on that button then i run a function to process data.
As far as readability, its getting pretty long and finding things when i need to change them is taking some time. I was looking into ajax for php form submit so i can do it without refreshing (with php self i dont have to refresh and i like it this way).
As far as performance goes....which is better; the ajax form process or php self form process?
php mysql (html?) echo 'username' problem
in PHP Coding Help
Posted · Edited by a246530
To accomplish this i set the username as a session variable (mostly because i had it display on all pages at the top right so the user could verify it was them as well as change any settings for their account). I am not sure if this is what you would want to do, but seeing as you already have a session going it seems like the easiest approach.
I had a box when the user signs in for their username and literally just posted it to session username.
$_SESSION['username']=$_POST['username'];
As far as your line, echo "Welcome 'username'" is concerned, You arent actually telling it to echo the username you would have for that person, but rather just username itself.