Jump to content

trafix

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Posts posted by trafix

  1. i changed th code to ............

    [code]
    $lognameaa=strtolower($logname);
    $userinfoaa[username]=strtolower($userinfo[username]);

            if ($lognameaa==$userinfoaa[username])
            {
                if ($logpass==$userinfo[password])
                {
                    $exptime=time()+60*60*24*3;
                    setcookie("usercookie",$logname,$exptime);
                    setcookie("passcookie",$logpass,$exptime);
                    header ("Location: index.php");
                }
                else
                {
                }
            }
            else
            {
            }
    [/code]

    no change ... logs in on one domain but not the other
  2. Hi there,

    Need help! ....

    I have 2 domains 

    xxxx.com
    xxxx.com.au is parked in the above server.

    when a user logs into one of them i need to be able to set the cookie(s) so the user is logged into both.

    Currently if they log into one and go the the other extension, they are not logged in and it is driving my members batty .....

    Can you assist me?

    Trafix
  3. [!--quoteo(post=381463:date=Jun 8 2006, 11:31 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 8 2006, 11:31 AM) [snapback]381463[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    And why exactly would that be a problem?
    [/quote]

    Off the top of my head
    [code]
        $delivery=$DB_cms->query("Select postcode From ".$tblext."freight where memid = '$userinfo[id]'");
        
        $postcodes=$DB_cms->query("Select * From ".$tblext."freight_codes order by state");
      
        while($codelist=$DB_cms->fetch_array($postcodes))
        {  
        
            foreach ($delivery as $value)
            {
               
                 if($value == $codelist[postcode])
                {
                    $checked="checked";
                }            
            }
          
            eval("\$temp[checkbox] .= \"".$template[checkbox]."\";");        
              unset($checked);        
        }
    [/code]

    is this how you would do it?
  4. Hmmm,

    i have a table that contains the australian post codes .... as per your post

    and a second table that holds the courier information and i have added their delivery addersses to that table IE 2000,2001,2002
    when a courier search is performed i can explode the postcode data to get the individual post codes to make the comparison the the 2 entered in the form.

    Great above can work great, however the problem is when the courier goes to edit their delivery points, as i have to show the perviously selected postcodes as checked in the perspective checkboxes.

    hmmmm
  5. Im not supprised though.

    As per my previous help topic, I am coding a freight finder where members of my site can enter the pick up & delevery post code into a form to get a list of couriers that may be able to be of service to them.

    As Australia has over 2000 postcodes i tried to allocate field names as each postcode, however the database table crashed and burned :(

    I thought about having a 8 seperate DB tables, one for each state of Australia. Currently my code to retrieve the 2 post codes entered in the form

    [code]
    $getmyinfo=$DB_cms->query("Select * From ".$tblext."freight Where `$delivery` = '1' and `$pickup` = '1' ORDER BY postcode");    
    [/code]

    I presume i will have to select from the 8 tables using JOIN.

    I have not learnt how to join tables as yet, does anyone want to point me in the right direction?

    Thanks in advance.
  6. [!--quoteo(post=381233:date=Jun 7 2006, 08:08 PM:name=trafix)--][div class=\'quotetop\']QUOTE(trafix @ Jun 7 2006, 08:08 PM) [snapback]381233[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    i did try that earlier but still get an error
    [code]
    Invalid SQL: UPDATE freight
                SET `800`=1
                blank = 1        
            WHERE memid='xx'
            
    mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blank = 1        
            WHERE memid='xx'' at line 3

    mysql error number: 1064
    [/code]
    [/quote]

    Yep, got it now .... thanks for your help
  7. [!--quoteo(post=381232:date=Jun 7 2006, 08:06 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 7 2006, 08:06 PM) [snapback]381232[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']UPDATE[/span] freight SET `800`[color=orange]=[/color]1, `810`[color=orange]=[/color]1 # [color=blue]and[/color] so on [!--sql2--][/div][!--sql3--]

    Should work.
    [/quote]

    i did try that earlier but still get an error
    [code]
    Invalid SQL: UPDATE freight
                SET `800`=1
                blank = 1        
            WHERE memid='xx'
            
    mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'blank = 1        
            WHERE memid='xx'' at line 3

    mysql error number: 1064
    [/code]
  8. let me explain the function

    i want to create a point to point delivery guide for my website so members can enter 2 postcodes and retreive a list of couriers that deliver/pickup from both given postcodes.

    I have set up 2 BD tables
    1) contains a list of all postcodes

    [code]
    CREATE TABLE `freight_codes` (
      `id` int(8) NOT NULL auto_increment,
      `postcode` int(5) NOT NULL default '0',
      `locality` varchar(225) NOT NULL default '',
      `state` varchar(50) NOT NULL default '0',
      `delivery_office` varchar(225) NOT NULL default '',
      `bspname` varchar(225) NOT NULL default '',
      `agentid` int(8) NOT NULL default '0',
      `depot` tinyint(2) NOT NULL default '0',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15736;

    --
    -- Dumping data for table `freight_codes`
    --

    INSERT INTO `freight_codes` VALUES (1, 800, 'DARWIN', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (2, 810, 'ALAWA', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (16, 812, 'ANULA', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (25, 820, 'BAGOT', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (44, 822, 'ACACIA HILLS', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (84, 828, 'BERRIMAH', 'NT', 'BERRIMAH', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (86, 829, 'PINELANDS', 'NT', 'DARWIN DC', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (87, 830, 'ARCHER', 'NT', 'PALMERSTON', 'DARWIN', 0, 0);
    INSERT INTO `freight_codes` VALUES (98, 832, 'BAKEWELL', 'NT', 'PALMERSTON', 'DARWIN', 0, 0);
    etc
    [/code]

    The second table contains the delivery points that the courier has nominated.
    [code]
    CREATE TABLE `freight` (
      `id` int(8) NOT NULL auto_increment,
      `memid` int(11) NOT NULL default '0',
      `blank` int(2) NOT NULL default '0',
      `800` int(2) NOT NULL default '0',
      `810` int(2) NOT NULL default '0',
      `812` int(2) NOT NULL default '0',
      `820` int(2) NOT NULL default '0',
      `822` int(2) NOT NULL default '0',
      `828` int(2) NOT NULL default '0',
      `829` int(2) NOT NULL default '0',
      `830` int(2) NOT NULL default '0',
      `832` int(2) NOT NULL default '0',
      `835` int(2) NOT NULL default '0',
      `836` int(2) NOT NULL default '0',
      `837` int(2) NOT NULL default '0',
      `838` int(2) NOT NULL default '0',
      `840` int(2) NOT NULL default '0',
      `841` int(2) NOT NULL default '0',
      `845` int(2) NOT NULL default '0',
      `846` int(2) NOT NULL default '0',
      `847` int(2) NOT NULL default '0',
      `850` int(2) NOT NULL default '0',
      `852` int(2) NOT NULL default '0',
      `853` int(2) NOT NULL default '0',
      `854` int(2) NOT NULL default '0',
      `860` int(2) NOT NULL default '0',
      `862` int(2) NOT NULL default '0',
      `870` int(2) NOT NULL default '0',
      `872` int(2) NOT NULL default '0',
      `880` int(2) NOT NULL default '0',
      `885` int(2) NOT NULL default '0',
      `886` int(2) NOT NULL default '0',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2;

    --
    -- Dumping data for table `freight`
    --

    INSERT INTO `freight` VALUES (1,xx, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0);
    [/code]

    The field names are the available postcodes and set to 1 or 0 depending on if the courier delivers to that areacode.

    My problem is that with the field names being an integer i get datadase error when i update the table and try to set a field

    [code]
    if($action=="savedelivery")
    {
        if (is_array($goto))
        {
            $goto=serialize($_POST['goto']);        
              $del=unserialize($goto);    
              foreach($del as $postcode)
               {
                  $pcdata ="$pcdata $postcode=1,";
               }
            
            $DB_cms->query("UPDATE ".$tblext."freight
                SET $pcdata
                blank = 1      
            WHERE memid='".addslashes($userinfo[id])."'
            ");        
        }
    }
    [/code]
    The $goto(array) is posted from a form with a series of checkboxes for each postcode

    Is there a way to set intiger fieldnames ?
    Is there a better way of doing this?

    here is the error that i get
    [code]
    Database error:

    Invalid SQL: UPDATE freight
                SET  800=1, 810=1, 841=1, 880=1, 870=1, 860=1,
                blank = 1        
            WHERE memid='xx'
            
    mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '800=1, 810=1, 841=1, 880=1, 870=1, 860=1,
                blank = 1  

    mysql error number: 1064

    [/code]
  9. Ok this is an easy one but i just cant remember who to do it ... lol

    now how do i get carriage returns to display in html after the data is retrieved from the database?

    \\\\\\\\\\\ example of data ////////////////////

    this is
    a listing in
    a directory

    /////////////////////////////////////////////////

    if the user edits this info - wrap "physical" is used in the textarea to format the carriage returns ... easy

    but....

    what do i need to do to get the same format when displaying the info within the ditectory?

    currently it displays the string on 1 line eg

    this is a listing in a directory


    thanks in advance

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