Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Posts posted by dreamwest

  1. $return[] isnt a data map

     

     

    function sql_read( $dbname,$dbusername,$dbpassword )
    {
    $names = array();
    $password = array();
    
    
    $connect = @mysql_connect("mysql11.000webhost.com",$dbusername,$dbpassword) or die("Could Not Connect");
    @mysql_select_db ($dbname) or die("Could not find DataBase");
    
    
    $query = mysql_query("select * from users");
    $numrows = mysql_num_rows($query);
    
    if ($numrows > 0){
    
    while($row = mysql_fetch_assoc($query)){
    
    $names[] = $row["uname"];
    $password[] = $row["password"];
    $id = $row["id"];
    
    }
    $return = array($names,$password,$id);
    
    }else{
    $return = array();
    }
    
    
    return $return;
    }
    
    
    
    $names = array();
    
    $names = sql_read("XXXXXX","XXXXXX","XXXXXXX")[0];
    

     

  2. I have this cipher for a magnet arrangement, can someone crack it??

     

    707-28 1009-9-6 420/6 1434-30/1 322@7 1819=4-5 95+3=18 431>8 KEY 739/Y4681+UU312/1J000(766HH DKEY) 6/12/LLL394H3M

  3. Those burning flames smell like a good lawsuit.

     

    @dreamwest: dude, you're totally fuckin' up the integrity of intellectual speak amongst this place.  We can't have trolls masturbating to threads in Misc... that's really creepy.

     

    was a joke...anyway dont u find this post sexy?

  4. Its alot easier to use SET instead of VALUES, because you can see which field is what.

     

    mysql_query ("INSERT INTO `business` SET `Name`='{$Name}' ,  `Type`='{$drop}', `Subtype`='{$tier_two}', `Phone`='{$Phone}', `Email`='{$Email}', `Postcode`='{$Postcode}', `Web Address`='{$Website}' ")or die(mysql_error());

  5. Ive drawn some database info but i need to change one key value

    while ($new = mysql_fetch_assoc($res)){
        $latest[] = $new;
    }
    print_r($latest);

     

     

    which prints:

    Array ( 
    
    [0] => Array ( 
    [id] => 1063636 
    [vid] => 41321 
    [es_title] => another title
    )
    
    [1] => Array ( 
    [id] => 1063635 
    [vid] => 02003 
    [es_title] => another title
    )
    
    [2] => Array ( 
    [id] => 1063634 
    [vid] => 51605 
    [es_title] => another title
    )
    ) 

     

    How can i replace [es_title] with just [title] so it looks like this

    Array ( 
    
    [0] => Array ( 
    [id] => 1063636 
    [vid] => 41321 
    [title] => another title
    )
    
    [1] => Array ( 
    [id] => 1063635 
    [vid] => 02003 
    [title] => another title
    )
    
    [2] => Array ( 
    [id] => 1063634 
    [vid] => 51605 
    [title] => another title
    )
    ) 

     

     

  6. It works. But its also taking the first $1 from each rewrite

     

    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^site.com [NC]
    RewriteRule (.*)$ http://www.site.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} !^www\.site.com
    RewriteCond %{HTTP_HOST} ^(ja|es|it|ar|pt|fr|de|hi|cn)\.site.com
    RewriteRule ^(.*)$ $1?lang=%1 [QSA]
    
    RewriteRule ^play/(.*)/(.*) index.php?nav=play&id=$1&t=$2 [L,QSA]

     

     

    So:

     

    http://ja.site.com/play/34/fun

     

    The id comes back as "ja" but it should be "34"

     

     

  7. Ignore my last code this is what i have

     

    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^site.com [NC]
    RewriteRule (.*)$ http://www.site.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} !^www\.site.com
    RewriteCond %{HTTP_HOST} ([^.]+)\.site.com
    RewriteRule ^(.*)$ index.php?lang=%1
    
    # Main pages
    
    RewriteRule ^view/(.*)/(.*) index.php?nav=play&id=$1&t=$2 [L,QSA]

  8. Is this smarty templates??

     

    Normally you would store the data as an array then assign it

     

    PHP:

    $e = mysql_query("select Requster_Name from request");
         while ($row = mysql_fetch_assoc($e)) {
         //extract($row);
         $RN[] = $row[‘Requster_Name’];
         }
    $easy->assign("RN", $RN);
    $easy->display("TEMPLATE.tpl");

     

  9. ive set up subdomain rewrite as follows, the only problem is none of the other rewites work on the subdomian

     

    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^site.com [NC]
    RewriteRule (.*)$ http://www.site.com/$1 [L,R=301]
    
    RewriteCond %{HTTP_HOST} !^www\.site.com
    RewriteCond %{HTTP_HOST} ([^.]+)\.site.com
    RewriteRule ^(.*)$ /home/site.com/index.php?lang=%1
    
    # Main pages
    
    RewriteRule ^$ index.php
    RewriteRule ^view=(.*) index.php
    RewriteRule ^sort=(.*) index.php
    RewriteRule ^page=(.*) index.php

     

    So if i go to http://www.site.com/view=1 it works but if i go to http://es.site.com/view=1 it only shows the main page aka http://es.site.com

     

×
×
  • 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.