Search Results

Search found 8942 results on 358 pages for 'print r'.

Page 204/358 | < Previous Page | 200 201 202 203 204 205 206 207 208 209 210 211  | Next Page >

  • Problem carrying Session over to other pages

    - by AAA
    I am able to login a user, but while processing to the next page (memebers area) I can't display any user info let alone print the $_SESSION[email]. I am not sure what's up. Below is the login code and the testing members are page. Login page: session_start(); //also in a real app you would get the id dynamically $sql = "select `email`, `password` from `accounts` where `email` = '$_POST[email]'"; $query = mysql_query($sql) or die ("Error: ".mysql_error()); while ($row = mysql_fetch_array($query)){ $email = $row['email']; $secret = $row['password']; //we will echo these into the proper fields } mysql_free_result($query); // Process the POST variables $email = $_POST["email"]; //Variables $_SESSION["email"] = $_POST["email"]; $secret = $info['password']; //Checks if there is a login cookie if(isset($_COOKIE['ID_my_site'])) //if there is, it logs you in and directes you to the members page { $email = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT email, password FROM accounts WHERE email = '$email'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if (@ $info['password'] != $pass) { } else { header("Location: home.php"); } } } //if the login form is submitted if (isset($_POST['submit'])) { // if form has been submitted // makes sure they filled it in if(!$_POST['email'] | !$_POST['password']) { die('You did not fill in a required field.'); } // checks it against the database if (!get_magic_quotes_gpc()) { $_POST['email'] = addslashes($_POST['email']); } $check = mysql_query("SELECT email,password FROM accounts WHERE email = '".$_POST['email']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { die('That user does not exist in our database. <a href=add.php>Click Here to Register</a>'); } while($info = mysql_fetch_array( $check )) //gives error if the password is wrong if (@ $_POST['password'] != $info['password']) { die('Incorrect password, please try again'); } else { // if login is ok then we add a cookie $_POST['email'] = stripslashes($_POST['email']); $hour = time() + 3600; setcookie(ID_my_site, $_POST['email'], $hour); setcookie(Key_my_site, $_POST['password'], $hour); //then redirect them to the members area header("Location: home.php"); } } } else { // if they are not logged in ?> <?php } ?> home.php session_start(); if(!isset($_SESSION['email'])) { header('Location: login_test3.php'); die('<a href="login_test3.php">Login first!</a>'); } //Variables $_SESSION["email"] = $email; print $_SESSION['name']; UPDATE Just realized the existing code gets in to the home.php file but will not echo anything. But as soon as you hit refresh the session is gone.

    Read the article

  • See socket options on existing sockets created by other apps?

    - by nailer
    I'd like to test whether particular socket options have been set on an existing socket. Ie, pretty much everything you can see in: #!/usr/bin/env python '''See possible TCP socket options''' import socket sockettypelist = [x for x in dir(socket) if x.startswith('SO_')] sockettypelist.sort() for sockettype in sockettypelist: print sockettype Anyone know how I can see the options on existing sockets, ie those created by other processes? Alas nearly all the documentation I read on Python socket programming is about making new sockets.

    Read the article

  • A good Java library for network math

    - by perilandmishap
    I'm looking for a Java library that is geared towards network math and already tested. Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet. Should I roll my own, or is there already a robust library for this?

    Read the article

  • Dynamic Iframe printing

    - by zachary
    I want to dynamically set the content of an iframe to that of an html document I have. It is in the form of a string in memory in javascript. Then i want to print that iframe. Ideas?

    Read the article

  • how to run g95 executable files in OS X terminal

    - by lollygagger
    I am completely new to this game, so please be gentle ;-) I made an example program in Fortran 90, lets call it 'program.f90'. I compile it: g95 program.f90 It creates an executable called a.out How do I run this? It is supposed to print something to the screen, and get input from me, but I cannot figure out how to!

    Read the article

  • reading from file

    - by lego69
    can somebody help me, how can I filter my file, inside the file I have rows with 3, 4, 5 elements, I want print using echo only these which have 5 elements, thanks in advance (I'm talkin about scripts)

    Read the article

  • PHP mysql_fetch does not return values

    - by Petr
    Hi, Being quite new with PHP, I cannot find any solution why this does not work. The query is OK and the resource is returned. But I dunno why fetch_assoc does not print values. Thanks $query=sprintf("SELECT ID,NAME FROM USERS WHERE PASS='%s' AND NAME='%s'",mysql_real_escape_string($p),mysql_real_escape_string($n)); $result=mysql_query($query); if ($result) { while ($row = mysql_fetch_assoc($result)) { echo $row['ID']; echo $row['NAME']; } } }

    Read the article

  • Conversion char[] to char*

    - by sijith
    may be this is a sizzle question but please help void Temp1::caller() { char *cc=Called(); printf("sdfasfasfas"); printf("%s",cc); } char *Temp1::Called() { char a[6]="Hello"; return &a; } Here how to print Hello using printf("%s",cc);

    Read the article

  • How can I call a method given only its name?

    - by mfolnovich
    I'm trying to have method void run( string method ) which would run method in that class. For example: class Foo { public: void run( string method ) { // this method calls method *method* from this class } void bar() { printf( "Function bar\n" ); } void foo2() { printf( "Function foo2\n" ); } } Foo foo; int main( void ) { foo.run( "bar" ); foo.run( "foo2" ); } this would print: Function bar Function foo2 Thanks! :)

    Read the article

  • What is the best way to include a php file as a template?

    - by Jon
    I have simple template that's html mostly and then pulls some stuff out of SQL via PHP and I want to include this template in three different spots of another php file. What is the best way to do this? Can I include it and then print the contents? Example of template: Price: <?php echo $price ?> and, for example, I have another php file that will show the template file only if the date is more than two days after a date in SQL.

    Read the article

  • Why is the PrintDialog not displaying (in 64 bit)?

    - by Bill
    This code, when built in .Net for Any CPU platform and running on a 64-bit machine, simply returns a DialogResult of Cancel without showing the expected dialog box. Dim dlg As New System.Windows.Forms.PrintDialog If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then '... print the document ' End If However, it works fine when the application is built for the x86 platform, and run on a 64-bit machine. How can you display the dialog with a 64-bit compile?

    Read the article

  • sidewaysfire and twosided

    - by hanno
    I try two use sidewaysfigure from the rotating package in the twosided memoir class. The resulting figures look correct in the pdf that is generated, with the page rotated by 90 degrees. However, when I print the document (on linux, using CUPS), some of the pages with a sidewaysfigure are upside down (rotated by 180 degreeS).

    Read the article

  • please help me to solve problem

    - by davit-datuashvili
    hi everybody fisrt of all this is not homework and now question is like this suppose i have array int a[]=new int[]{0xBCDA,0xABFE,0xBCAD,0xEFCA,0xFFCA} i know that there is always some hexadecimal number which occurs in all number or in this case A is repeat in array everywhere so my aim is print only repeat number and other numbers should be zero so my new array should be like this 0x000A, 0xA000,0x00A0 0x000A,0x000A any idea please help me? p.s please nobody say that this is homework

    Read the article

  • Is `std::string(strerror(errno))` dangerous?

    - by StackedCrooked
    At some places in my code, I print debug messages like this: int ret = getLinkSpeed(device.getSysName(), linkSpeed); if (ret < 0) { logDebug("Failed to obtain port speed for this device. Error: " + std::string(strerror(errno))); } From the documentation it is not entirely clear if strerror will return 0 under certain conditions (which would cause my code to crash). Does anyone know if it's safe?

    Read the article

  • _REQUIREDNAME always nil

    - by Nali4Freedom
    I'm trying to use the method for naming a lua package after the filename mentioned here, however _REQUIREDNAME is never defined. For example I have these two files samplePackage.lua: print("_REQUIREDNAME: ", _REQUIREDNAME) return nil; packageTest.lua: require "samplePackage" And when I run packageTest.lua it outputs > _REQUIREDNAME: nil I also couldn't find any mention of _REQUIREDNAME in the Lua 5.1 Refrence manual, so was this removed from the language, or am I missing something?

    Read the article

  • recaptcha problem please help me

    - by moustafa
    please see the following code // redirect to success page if ($success){ header( 'Location: ../Scripts/_lib/phpmailer-fe.php'); } else{ print "<meta http-equiv="refresh" content="0;URL=error.html">"; } its not working

    Read the article

  • Open file from server and send to browser

    - by netmajor
    Hey, In my asp.net application I create pdf file and save it in App_Data folder on server. Next I want to open this file that user can print it. How to open this file in browser ? Send it in http header etc ? Someone have some examples? Please help ;)

    Read the article

  • Python: Random integer

    - by user3696440
    I been hitting a wall thats been keeping me from tinkering on a game. class Damage: def shortsword(): shortsword=randint(1,6)+1 shortsword=int(shortsword) return shortsword I been wanting this number to pop up as part of a message on print and then use the same number as part of another function to help with subtracting of health on the target. Though each time I grab this it is always going to change.

    Read the article

< Previous Page | 200 201 202 203 204 205 206 207 208 209 210 211  | Next Page >