About php problem

for example :
first php code:(login.php)
<?php
session_unset();
?>
<html>
<head>
<title>Please Log In</title>
</head>
<body>
<form method="post" action="movie1.php">
<p>Enter your username:
<input type="text" name="user">
</p>
<p>Enter your password:
<input type="password" name="pass">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
</body>
</html>
second php code:(movie1.php)
<?php
//delete this line: setcookie('username','Joe', time()+60);
session_start();
$_SESSION['username'] = $_POST['user'];
$_SESSION['uerpass'] = $_POST['pass'];
$_SESSION['authuser'] = 0;
//Check username and password information
if (($_SESSION['username'] == 'Joe') and
($_SESSION['userpass'] == '12345')) {
$_SESSION['authuser'] = 1;
} else {
echo "Sorry, but you don't have permission to view this
page,you loser!";
exit();
?>
<html>
<head>
<title>Find my Favorite Movie!</title>
</head>
<body>
<?php
$myfavmovie = urlencode("Life of Brian");
echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</body>
</html>
the last php code:(moviesite.php)
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_SESSION['authuser'] != 1) {
echo "Sorry, but you don't have permission to view this
page, you loser!";
exit();
?>
<html>
<head>
<title>My Movie Site - <?php echo $_REQUEST['favmovie']; ?></title>
</head>
<body>
<?php
echo "Welcome to our site. ";
// delete this line: echo $_COOKIE['username'];
echo $_SESSION['username'];
echo "! <br>";
echo "My favorite movie is ";
echo $_REQUEST['favmovie'];
echo "<br>";
$mvovierate = 5;
echo "My movie rating for this movie is: ";
echo $movierate;
?>
</body>
</html>
</body>
</html>
i[b] want to use session to create user privilege to visit and to run sql code.
who can test them and help me find that error which cause them not to work.
thanks

thanks a lot!
many questions have been solveted by you!
thank you very much!

Similar Messages

  • Questions About PHP

    I guess this is the best place to post this since my problems are with php and xml, and with compiling c code. I'm using the Phoronix Test Suite, which is entirely PHP based (you need to install the php package, not a whole webserver for it to work) and pretty poorly documented, and if you want to use extra features that dont come with the main package you have to install them yourself which is a major roadblock from someone like me who knows absolutely nothing about PHP. The program itself works fine, the problems I have are with using the additional features. Ive posted a thread over there yesterday but their forum doesnt seem to be that active.
    First off to export your results to a pfd file you have to have the fpdf module (fpdf.php) but I have no idea where to put it, Ive googled it but all ive found is that you can put it anywhere that include() can look but I have no idea where include CAN look lol. Ive looked through /etc/php/php.ini and a few of the php files for the PTS but cant find it defined anywhere. Ive put it where all the other php modules are in /usr/lib/php/modules but when I try to use the module in PTS via phoronix-test-suite result-file-to-pdf it says that I need to have the fpdf program installed for it to work.
    Second problem (?) I have is with viewing the results in a web browser. After a benchmark completes it asks you if you want to view the results in a web browser and if I select yes the results are shown but theyre nearly impossible to read since its all one big block of text with no spaces. The results are stored in an xml file called composite.xml and there are two other xml files in the same folder called pts-results-viewer.xsl and test-1.xml (which is just another results file from a previous test), there is also an html file called index.html which just references the composite.xml file in its code. I know very little about HTML and XML but almost everytime Ive tried to load an xml file in a web browser it displays either the source of the file or just a big unformatted block of text, so I dont know if this is really an error or if its supposed to be like this.
    The third problem I have is with php-gtk. If I simply install the php-gtk package with pacman it installs fine but when I try to load the program from the console using phoronix-test-suite gui its gives me the following errors:
    PHP Warning: PHP Startup: php-gtk: Unable to initialize module
    Module compiled with module API=20060613
    PHP compiled with module API=20090626
    These options need to match
    in Unknown on line 0
    The PHP GTK module must be loaded for the GUI.
    This module can be found @ http://gtk.php.net/
    I remember reading that php-gtk from the aur said that it used a modified php-gtk.ini and that I should tell all the programs to use that file instead of the default one, so with the php-gtk package installed via pacman I tried to open the program via php-gtk -c /etc/php/php-gtk.ini /usr/share/phoronix-test-suite/pts-core/phoronix-test-suite.php, it says the same thing.
    If I try to compile php-gtk from source using aurbuild the compilation errors out about 85% of the way through (right at the GTK Coverage portion) with about 100 or so error: duplicate 'static' errors in various header files. Ive tried everything that I cant think of to try and remedy this but nothing seems to work.
    These are the things that Ive tried:
    building dependencies from the aur
    syncing dependencies from pacman
    removing the php package that I installed via pacman and building it with aurbuild --build-deps php52 (the package named php had errors in the pkgbuild so i used php52 and changed the package name to php in the pkgbuild) and then building php-gtk
    following this guide to make sure that I have all the dependencies that I need and that they are compiled/installed in the order that they should be.
    None of which have worked, they all give the same errors. The only thing I havent tried is manually compiling everything without using abs/aurbuild and following the instructions on the page I linked to.
    In case its helpful, heres the php modules that are loaded:
    [PHP Modules]
    Core
    ctype
    date
    dom
    ereg
    fileinfo
    filter
    gd
    gettext
    hash
    libxml
    mbstring
    mysqlnd
    pcntl
    pcre
    posix
    readline
    Reflection
    session
    SimpleXML
    SPL
    standard
    tokenizer
    xml
    xmlreader
    xmlwriter
    zlib
    [Zend Modules]
    Can anyone clue me in on any of this?
    Last edited by brando56894 (2009-10-07 00:35:27)

    Thanks for the info, I finally got the gui to work I manually compiled (almost) everything, stuff that errored out I cheated and installed with pacman and gtk-php finally compiled successfully, the pkgbuild I was initally using probably didnt include some of the flags that were needed. I had to use the configure flag --disable-gtktest while I was configuring php-gtk or else it would complain that gtk+ >= 2.6.0 wasnt installed even though I have gtk-2.16.5-1 installed.
    After about 2 hours of downloading and compiling it still gave me the API error I mentioned before, needless to say I wasnt too happy. I googled again and found a bug-report about the same error and it said that its usually do to leftover files from an older installation. One person mentioned when they upgraded from ubuntu edgy to feisty-beta they got this error and found out that an old version of the php binary was there and the newest one was called php5 so they removed the old one and made a link from php5 to php. Just for the hell of it I checked out my /usr/bin for the same problem, it wasnt that obvious though. php was there, php-config was there and the link I had just created called php-gtk2 was there.
    The previous two were from 9/27/09 while the link was obviously from today. I added .old to the names of php and php.conf and made a link from /usr/local/php-5.2.3/bin/php -> /usr/bin/php, added extension=php_gtk2.so to /etc/php/php.ini (actually it was already there from when I was messing around before) and ran phoronix-test-suite gui and finally it worked.
    I tried place fpdf.php in my modules directory but its still not finding it and it (and i) are gettting confused since the tutorial I was following installed stuff into /usr/local/php-gtk-2.01 and not the default location. I'm going to go into my other installation and see if I can get everything to work with just pacman since I know what (one of the) actual problem(s) is. If not Im going to create a pkgbuild for it because this was a HUGE pain in the butt.
    Heres the composite.xml, the PTS-results-viewer.xsl and the Index.html

  • TS3212 Why can't I find a help # to call about my problem "iTunes has stopped working"

    "iTunes has stopped working"
    Acer  system, Windows 8, trying to download iTunes for Windows 8.  Partial loads but at @ 75% stops. Worked with prior version of Windows transferred over.
    Full message: "A problem caused the program to stop working correctly, Windows will close the program and notify you if a solution is available."
    Troubleshooter didn't help, removing and down loading iTunes for Windows 8 did not work. same message each time.
    Windows message says its an "incompatible program."
    How do I get this to load correctly?  AND HOW IN THE WORLD CAN I TALK TO SUPPORT ABOUT THIS PROBLEM, I HAVE SPENT 1/2 DAY TRYING

    Apple don't provide free telephone support for iTunes.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it, which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • I've checked my current plugins and it still shows Adobe Acrobat Version 7 for Netscape (7.0.9.50) I tried to do the update but I got an error - "Please tell Microsoft about this problem" "Send Error Report/ Don't Send".

    I've checked my current plugins and it still shows Adobe Acrobat Version 7 for Netscape (7.0.9.50)
    I tried to do the update but I get the same error each time - "Please tell Microsoft about this problem" "Send Error Report/ Don't Send".
    Also, do I need to Disable or Uninstall the Extension: "SEO For Firefox 3.3.4 as this was highlighted?
    == This happened ==
    Every time Firefox opened
    == When I try to do the update

    http://www.microsoft.com/mac/support
    http://answers.microsoft.com/en-us/mac/forum/macword?auth=1
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macword/microsoft-wor d-for-mac-2011-will-not-open-error/ecc42616-6f49-40bb-b8f5-e21c711ea359

  • Firefox 4 Beta crashes everytime I open it. Then I'm forced to close the program and it won't let me restart it since it says it's already running. Which isn't true. I'm done trying it. Do you guys know about this problem?

    Everytime I start Firefox 4 beta it crashes. I usually can visit one site on the web (doesn't matter what site) and then it locks up. The only thing that works on the browser then is the close button. After clicking the close button I'll try to restart the browser and I'll get an error message saying it can't open Firefox because it's already open. Which is a bunch of BS. The only I can get Firefox started again is to restart my computer. This is so frustrating that I've given up trying. Hopefully you guys know about this bug and can do something about it. I wasn't trying to post a question here I just wanted to make sure you guys heard about this problem.

    yeah it is the gayest thing that happens :S what i do is turn off the internet, then open it, then turn on internet, then use it. :S OR make your homepage a tab.

  • I have a hard time understanding why I can't contact support about YOUR problem. I plugged my iPhone into my pc. iTunes came up. It said there was an update available for the phone. I accepted that. Clicked on the "download only" because I didn't have the

    I have a hard time understanding why I can't contact support about THEIR problem. I plugged my iPhone into my pc. iTunes came up. It said there was an update available for the phone. I accepted that. Clicked on the "download only" because I didn't have the time to install it at that point. It downloaded but didn't stop. It continued to the 'backing up your iPhone' segment then froze. I waited at least an hour with no change. Finally I unplugged my phone..iTunes wasn't responding.I rebooted my pc then tried the same thing again. Same outcome even though I let it "Back Up" for 7-8 hrs while I slept. Same Story...............         iTunes 10.4.0.80 is the software I'm using. When my phone is 'plugged' in what I see on it's face is "Sync in Progress".....for hours!

    Error 1611
    This error typically occur when security software interferes with the restore and update process. FollowTroubleshooting security software issues to resolve this issue. In rare cases, this error may be a hardware issue. If the errors persist on another computer, the device may need service.
    Synced media like apps and music are not included in the iPod backup that iTunes makes. You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • About Deployment problem

    Hi,
    I am doing my MSc dissertation about "The Impact of Visual Composer upon Business Requirements Gathering".
    When I am triied to deploy my application, I got this error message
    Deploying.....
    Error in executing a process for flex compilation, not enough space.
    Can you give me a solution for this, coz i couldn't do further more without this.
    I am waiting for favourable reply.
    Best Regards,
    Dinusha.
    Edited by: Dinusha Somarathne on Dec 7, 2008 3:46 PM

    Hi Dinusha,
    Can you please supply us with more details about the problem:
    1. What Version of Visual Composer are you using?
    2. What have you added to the model?
    3. Is the error consistent or only appears when you have a vertain object in your Visual Composer Model?
    Thanks,
    Omer.

  • The Operation could not be completed. No other information is available about the problem.

    MAC OSX 10.8.5
    Processor 2.7 GHz
    Memory 4GB1333 MHz DDR3
    Logic Pro 9.1.8 (1700.67) 32 BIT
    "The Operation could not be completed. No other information is available about the problem."
    Uploaded on google drive a series of project files. downloaded them and now the message above is what pops up effectively blocking me from my work. After talking with google support, they confirmed the successful upload and download with no file corruption. All file extensions are the same. Can someone please help.
    Sincerely,
    Butta Love

    Try the following..
    Compress the audio files before uploading them to Google.. using Apple's built in file compressor... (Right/Control click on an audio file and choose compress from the popup menu...
    Download from Google and then decompress audio files..
    Now test in Logic and see if you get the same issue....

  • When I try to make a new video, a window comes up that says,"The operation could not be completed," and then under it, it says,"No other information is available about the problem," what is happening and how do I fix it?

    when I try to make a new video, a window comes up that says,"The operation could not be completed," and then under it, it says,"No other information is available about the problem," what is happening and how do I fix it?

    Hi
    And without info - it's near to impossibly to help. Try my general troubleshooting note:
    Troubleshooting note
    When iMovie doesn't work as intended this can be due to a lot of reasons
    iMovie Pref files got corrupted - trash it/they and iMovie makes new and error free one's
    problem in iMovie Cache folder - trash Cache.mov and Cache.plist
    Creating a new User-Account and log into this
    This forces iMovie to create all pref. and cache files new and error free
    Event or Project got corrupted - try to make a copy and repair
    a Codec is used that doesn't work (even though iMovie and/or iDVD tries to / they fail in the end)
    version miss match of QuickTime Player / iMovie / iDVD
    preferences are wrong - Repair Preferences
    other hard disk problem - Repair Hard Disk (Disk Util tool - but start Mac from ext HD or DVD)
    External hard disks - MUST BE - Mac OS Extended (hfs) formatted to work with Video
    ( UNIX/DOS/FAT32/Mac OS Exchange - works for most other things - but not for Video )
    USB-flash-memories - usually do not work
    Net-work connected hard disks - usually do not work (most often not fast enough and WRONGLY FORMATTES as DOS etc)
    iPhoto Library got problems - let iPhoto select another one or repair it. Re-build this first then try to re-start iMovie. When iMovie starts-up it first look trough this iPhoto library and if faulty it all Halt’s.
    This You do by
    First -  close iPhoto
    Secondly - on start up of iPhoto - Keep {cmd and alt-keys down}
    Thirdly - now select all five options presented
    THEN - WAIT a long long time (>20 hours are not strange)
    free space on Start-Up (Mac OS) hard disk to low (<1Gb) - I never go under 25Gb free space for SD-Video (4-5 times more for HD)
    external devices interferes - turn off Mac - disconnect all of them and - Start up again and re-try
    GarageBand fix - start GB - play a few notes - Close it again and now try iMovie
    Screen must be set to million-colors
    Third-party plug-ins doesn't work OK
    Run "Cache Out X", clear out all caches and restarts the Mac
    Let Your Mac be turned on during one night. At about midnight there is a set of maintenance programs that runs and tidying up. This might help
    Turn off Your Mac - and disconnect Mains - for about 20-30 minutes - at least this resets the FireWire port.
    In QuickTime - DivX, 3ivx codec, Flip4Mac, Perian etc - might be problematic - temporarily move them out and re-try
    (I deleted the file "3ivxVideoCodec.component" located in Mac HD/Library/Quicktime and this resolved my issue.)
    buenrodri wrote
    I solved the problem by removing the file: 3ivxVideoCodec.component. after that, up-dated iMovie runs ok.
    Last resort: Trash all of iMovie and re-install it
    Yours Bengt W

  • Every time i try to create a new movie or a trailer an error message appear saying:"the operation could not be completed. no other information is available about the problem."

    every time i try to create a new movie or a trailer an error message appear saying:"the operation could not be completed. no other information is available about the problem."

    Open the iCloud preference pane and uncheck the Contacts box. Do the alerts stop?

  • Contacts application error: The Operation could not be completed. No other information is available about the problem.

    I get about one or two of these error messages, from Contacts each day: "The Operation could not be completed. No other information is available about the problem." It seemed to start after I deleted some of what appeared to me to be the duplicate cards between "On My Mac" and iCloud. I have Contacts version 9.0 in OS X 10.10 Yosemite on a MacBook Pro (15-inch, Early 2011). Anyone else seen this error?

    Try the following..
    Compress the audio files before uploading them to Google.. using Apple's built in file compressor... (Right/Control click on an audio file and choose compress from the popup menu...
    Download from Google and then decompress audio files..
    Now test in Logic and see if you get the same issue....

  • Contacts error: The Operation could not be completed. No other information is available about the problem.

    I get about one or two of these error messages, from Contacts each day: "The Operation could not be completed. No other information is available about the problem." It seemed to start after I deleted some of what appeared to me to be the duplicate cards between "On My Mac" and iCloud. I have Contacts version 9.0 in OS X 10.10 Yosemite on a MacBook Pro (15-inch, Early 2011). Anyone else seen this error?

    Thanks!  I looked at the Busycal post:
              To fix this, open System Preferences > Security & Privacy, select Contacts in the left sidebar, then check BusyCal.app.
    On my system, only Skype, Parallels, and Contacts Cleaner are enabled to access contacts.
    FYI, LinkedIn doesn't list any apps as having asked for, or been given access.
              If that doesn't work, here is a bigger hammer:
    OK
              1) Launch Terminal in /Applications/Utilities.
              2) Paste the following text and hit return:
                   tccutil reset AddressBook     
    First, I want to see what that does so I ran man tccutil
         NAME
              tccutil -- manage the privacy database
         SYNOPSIS
              tccutil command service
         DESCRIPTION
              The tccutil command manages the privacy database, which stores decisions the
              user has made about whether apps may access personal data.
              One command is current supported:
              reset    Reset all decisions for the specified service, causing apps to prompt
                       again the next time they access the service.
         EXAMPLES
              To reset all decisions about whether apps may access the address book:
                    tccutil reset AddressBook
              3) Quit Terminal.
              4) Launch BusyCal, and click OK when asked whether to allow access to your contacts.
    Now I see under System Preferences->Security&Privacy->Privacy->Contacts that all apps were removed from the list.
    I haven't had BusyCal in years so I just launched Calendar and Contacts.
    Unfortunately, as soon as I launch Contacts, I get the pop-up again about the LinkedIn

  • I movie  "The operation could not be completed. No other information is available about the problem." any suggestions?

    Bought i movie for my macbook pro. it crashed, now i can't use it "The operation could not be completed. No other information is available about the problem." any suggestions?

    Same problem!

  • Every time I launch Firefox it pops up an error stating "Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem."

    Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem.
    The statement above is in the pop up error box every time, when I launch Firefox. If I click ok in the box Firefox then opens. How do I fix this initializing/launch problem?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")<br />

  • HT4623 Is this the most up to date article on up dating the iPhone - it there anything about the problems relating to the up date to OS 6 - my G3 no longer works and Apple seems to have gone to ground.  No Genius bar appointments available for a week!

    Is this the most up to date article on up-dating the iPhone OS - is there anything about the problems relating to the up-date to OS 6 - my G3 no longer works and Apple seems to have gone to ground.  No Genius bar appointments available for a week!

    iOS 7 devices need iTunes 11.1 or newer to sync.  Depending upon your computer and the OS it is running, you may not be able to upgrade to iTunes 11.1 based on the requirements for iTunes 11.1.  What computer and OS are you running your iTunes on?  From the iTunes download pages I see the requiorements are:
    Macintosh System Requirements
    Mac computer with an Intel Core processor
    OS X version 10.6.8 or later
    400MB of available disk space
    Broadband Internet connection to use the iTunes Store
    Windows System Requirements
    PC with a 1GHz Intel or AMD processor and 512MB of RAM
    Windows XP Service Pack 2 or later, 32-bit editions of Windows Vista, Windows 7, or Windows 8
    64-bit editions of Windows Vista, Windows 7, or Windows 8 require the iTunes 64-bit installer
    400MB of available disk space
    Broadband Internet connection to use the iTunes Store

Maybe you are looking for

  • How can I transfer videos from my PC to my iPod touch (iOS 7.0.2)?

    Hi, I'd like to know how I can transfer videos from my PC to my iPod touch (iOS 7.0.2)? Thank u for your help.

  • Ical reminders list won't sort on iphone

    ICal Reminders won't sort on the actual device it was intended for - the Iphone I just talked to Apple Express service over this problem.  I went to the trouble of transferring my to-do list onto icloud Reminders - where each item asked for a priorit

  • Using XSLT Transformation to Load Deep Structure

    Greetings! I have the need to load data from an XML file into a structure that contains a nested table.   I've written the XSLT to load the basic structure but I'm not familiar enough with XSLT to know how to populate the nested table.  I've searched

  • Image Capture doesn't recognize SD card

    In Tiger I would pop in my SD card into a reader in my pcmcia slot and image capture would read it as a device and I could then use it to embed color profiles etc. as it downloaded to the correct folder. Leopard's Image Capture won't recognize the ca

  • How Can I Get Wav and Mic Options?

    When running Windows XP I had a Soundblaster sound card and when I wanted to brodcast Internet Radio, I went to the sound icon, Recording, and selected Mic to talk or Wav for playing music. On my new computer, I am running Windows 7 Professional. I h