Jump to content

pacome

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Posts posted by pacome

  1. I select from DB and en up with an array... the question is: is it possible to register the variables as session varibles with different names?

     

    $sqlVuelos = "SELECT * FROM vuelos ORDER BY RAND() LIMIT 4";

    $displayVuelos = mysql_query ($sqlVuelos) or die ('query wrong');

    mysql_query ($sqlVuelos) or die (mysql_error ($conVuelos));

     

    while ($rowVuelos = mysql_fetch_array($displayVuelos)) {

    $vuelo = $rowVuelos["vuelo"];

    $tipo = $rowVuelos["tipo"];}

     

    thank you...

  2. hi... I'm trying to program a small game for myself...

    I've got some data in a DB which I extract within a WHILE loop, but I would like the data extracted to print slowly, not all at once! let's evey 30 seconds interval...

     

    while ($cont < 8){

     

    extract data;

    print one of the 8 every 30 seconds;

    }

     

    ¿which function or line does this type of thing?

     

    thank you.

  3. I'm trying to insert into DB but it doesn't

     

    any ideas why?

     

     

    <?php

     

    function insertar ()

     

    {

    $con = mysql_connect ('','','') or die ("no conn");

    @mysql_select_db ('aerosim') or die ("hey somth wrong");

    $sql = "INSERT INTO vuelos (`vuelo`,`tipo`) VALUES ('$IBE','$tipo')";

    mysql_query ($sql) or die (mysql_error ($con));

    }

     

     

     

    if ($vuelo = ""){

    $vuelo=rand(1000,4000);}

    else{

    $vuelo = ($vuelo + rand(1000,5000));}

    echo "IBE".$vuelo;

    $IBE="IBE".$vuelo;

    $tipo = "A330";

    insertar($IBE, $tipo);

     

    ?>

    an id and timestamp variables are written to the DB each time I refresh the page, but the variables from the script don't get written... so connection is ok, but variables are not getting there...

     

    thanks!

  4. Hi!

    I'd like to make normal webs and not be restricted to 775px width... I know I could use the good old 100% width table, but the question is... what happens with the pictures ?? do I have to center them and not make them bigger than 775px in case somebody with a small monitor visits the web?

    thanks for your help.
  5. great it's working just fine!

    one more question!

    do I have to call the variable $_SESSION[nicksess] everytime or can I rename it let's say $nick and it will be availble with session_start() in other pages?

    thank you again
  6. I'm trying to pass some variables through a session with PHP 4.329 but I can't manage to get them through the pages...

    My host's has this info

    Session Support  enabled 
    Registered save handlers  files user 

    Directive Local Value Master Value
    session.auto_start Off Off
    session.bug_compat_42 Off Off
    session.bug_compat_warn On On
    session.cache_expire 180 180
    session.cache_limiter nocache nocache
    session.cookie_domain no value no value
    session.cookie_lifetime 0 0
    session.cookie_path / /
    session.cookie_secure Off Off
    session.entropy_file no value no value
    session.entropy_length 0 0
    session.gc_divisor 1000 1000
    session.gc_maxlifetime 1440 1440
    session.gc_probability 1 1
    session.name PHPSESSID PHPSESSID
    session.referer_check no value no value
    session.save_handler files files
    session.save_path /var/lib/php/session /var/lib/php/session
    session.serialize_handler php php
    session.use_cookies On On
    session.use_only_cookies Off Off
    session.use_trans_sid Off Off

    and my script is page 1:

    <?php
    session_start();
    session_name('ses');
    if ($_POST[nicksess])
    {
    $nicksess=$_POST['nicksess'];
    //$nicksess=$_POST[nicksess];
    //session_register("nicksess");
    echo "<html><body><a href='page2.php'>go to page 2</a><br>".$_POST['nicksess']." <br>y ".$nicksess."</body></html>";
    }
    else {

    ?>
    <html><head></head>
    <body>
    <form action='page1.php' method='POST'>
    <input type='text' name='nicksess'>Name<br>
    <input type='password' name='pass'><br>
    <input type='submit' name='submit' value='submit'></form>
    </body></html>
    <?php
    }
    ?>


    and page 2 is:

    <?php
    session_start();
    session_name('ses');
    echo "<html><body>Mi nick es:".$_SESSION["nicksess"]." </body></html>";

    ?>

    When I put my name I print correctly $_SESSION["nicksess"] and $nicksess, but when I click to page 2 the nick doesn't print! :(

    any ideas?

    thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.