I am trying a simple login/logout for my website. It works well with checking if the username exists in the database to logging in. I used $_SESSION['username']=$myusername; However, when I log-out, then I go to a page with this code
Code: <?php
session_start();
if($_SESSION['username']) //line5
echo "Welcome, ".$_SESSION['username']."!<br /><a href='logout.php'>Logout.</a>";
else
die ("You must be logged in!");
?>
It gives me an error. It says Notice: Undefined index: username in C:wampwwwdatbasmember.php on line 5
I just want to know how to fix this. Thank you
$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown reason i can echo the variable and it outputs the correct value but i cannot use that variable in
XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, here's the XML<categories> <category id="12345">
Ajax Issues - Update Panel / Timer. Intellisense doesn't know about them
Type 'System.Web.UI.ScriptManager' does not have a public property named 'UpdatePanel'.
Spaghetti Code
So.I've pretty much reached the point where I have so many isset s on one page that I can't tell what the page is supposed to do. In other words: spaghetti code. I just read a few tutorials on OOP,
show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i am checking if it is URL or not. if it is URL, let take an example google.com so it should take me
how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste it .... not really wanting to use a TEXTAREA box .... any ideas ?
Accept only alpha characters
I've got this bit of code ready for accepting a phrase:Code: if (!eregi ("", $_POST['phrase'])){but I need it to accept ONLY alphabet characters. No numbers, no spaces, no under scores, no
How to store checkbox array in a session, and then be able to add to it?
I'm trying to store an array of checkbox values into a session array, sort of like a shopping cart, but I can't figure out how to not overwrite the sessions array each time new checkbox values are
Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen242/html/staples/event.php on line 46I checked it over and couldn't find anything wrong with an extra
Small problem with image resize script
Hi!I am a little bit new to php and I have an issue installing an image resize script I downloaded (http://shiftingpixel.com/2008/03/03/smart-image-resizer/) and can't seem to get it working.Here's a