Jump to content

Chetan

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Posts posted by Chetan

  1. You guys, simple
    he uses variables in ''
     $insertfundquery = 'INSERT INTO longterm( fundname,'.
              'starrating, firstyear, thirdyear,'.
              'fifthyear, tenthyear, fifthteenyear)'.
              'VALUES ( "$fundname", "$starrating",'.
              '"$firstyear", "$thirdyear", "$fifthyear",'.
              '"$tenthyear", "$fifthteenyear")';

    Now you know wat to do

    Thats ofcourse not all but still a little or else you had come up with this error later
  2. Well unless you also want to parse png files in PHP here is how you do it.

    The place in apaches conf where you set which extensions should be parsed in PHP put png, jpg, gif
    and write image code in png to return a png file which can be saved.

    So you see you cant do it unless you wanna parse image files which only the server admin can do which i guess is not you
  3. The for loops
    change em

    [code]
    for($u=0; $u<=$num2; $u++)
    {
    $flds='';
    $dat='';
    for($i=0; $i<=$num; $i++)
    {
    $flds.='$fields['.$i'.]';
    $dat.='$data['.$i.']';
    }
    $exec = '$sql = \'INSERT INTO $table['.$u.']($flds) values($dat]);';

    // For debugging, you may uncomment this code
    // echo($exec);

    eval($exec);
    mysql_query($sql);
    }
    [/code]
  4. Sorry my internet got bad, here is what i had to post.

    The script which inserts data
    takes post variable- job
    [code]
    <?php
    // Considering, already connected to MySQL
    $job = $_POST['job'];
    $time = time();
    $expiry = time() + 60*60*24*90;
    $sql = 'INSERT INTO jobs(job, time, expiry_date, expire) values(\''.$job.'\', \''.$time.'\', \''.$expiry.'\', \'1\')';
    mysql_query($sql);
    ?>
    [/code]

    Now the page where you delete, include this in any page so this automaically expires extra jobs.

    [code]
    <?php
    // Considering connected to MySQL and have already put the job in
    // $job, time in $time and expiry_date in $expiry
    $time2 = time() - $expiry;
    $sql = 'UPDATE jobs SET expire = \'0\' WHERE time>'.$time2;
    mysql_query($sql);
    ?>
    [/code]

    Hope you understand it and it works
  5. FreeDNS does not have a program but you can use UPIP to change dynamic DNS.

    Norton Security well that does not relate to server but the thing is one cannot put virus files on your compu.

    I dint get much errors on freedns but that was sum weeks ago. And for hosting the site you do not need much.

    Port Forwarding is same as Virtual Server, here is what you should do.

    1. If you have a shortcut on desktop to your setting page for your routor go there or if you were specified with an ip address for that use it.
    2. Now goto Advanced tab.
    3. Virtual host.
    4. Goto start->run and type winipcfg(9x ME) ipconfig(WinXP)
    5. Get the ip address from there.
    6. In the page we had opened add a server which forwards port 80 to port 80 of your machine:
    The type: TCP
    Port start: 80
    Port End: 80
    Port map: 80
    IP: The ip we had found

    We need one more entry

    The type: TCP
    Port start: 443
    Port End: 443
    Port map: 443
    IP: The ip we had found

    Thats not all we need you have to make sure your settings page is not on port 80.
    in case it is:
    1. Tools tab
    2. Admin
    3. Change port to 8080 or what ever you want.

    You would have to use localhost to access your server from your computer and putting your lan ip which we got from ipconfig would work but using the external ip would not work. But the external ip works on any other computer on internet, to get the external ip goto: http://www.knowip.com
  6. [code]
    <?php
    // MySQL
    $conn=mysql_connect('localhost', 'root', '');
    $db   =mysql_select_database('database');
    $table=array('table1', 'table2', 'table3');

    // Declare feilds and data
    $fields = array('field1','field2','field3');
    $data = array($data1,$data2,$data3);

    // The script
    $num2= count($table);
    $num = count($field);

    for($u=0; $u<$num2; $u++)
    {
    for($i=0; $i<$num; $i++)
    {
    $exec = '$sql = \'INSERT INTO $table['.$u.']($fields['.$i.']) values($data['.$i.']);';

    // For debugging, you may uncomment this code
    // echo($exec);

    eval($exec);
    mysql_query($sql);
    }
    }
    ?>
    [/code]

    In case this dosent work uncomment the commented debugging line
×
×
  • 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.