Jump to content

zac1987

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Posts posted by zac1987

  1. try

    <?php
    $left = 0;
    $top = 0;
    $num = mysql_num_rows($result2);
    $len1 = ceil($num/3);
    $len2 = $len1 + floor($num/3);
    while($userinfo = mysql_fetch_array($result2)){    
        if($count==$len1){$top=30;  $left=100;}
        if($count==$len2){$top=0;  $left=200;}
        echo "<div style=\"left:{$left}px; top:{$top}px; position:absolute;\">{$userinfo['message']}</div>\n";
        $top +=60;
        $count++;
    }
    ?> 

     

    WOW. It is so hard to understand your code algorithm. Let's say $num=9, $len1=3, $len2=6.

    You didn't assign a value for $count, so $count=0, how can $count equal to $len1 or $len2? I have tested your code, it works for displaying the divs for 2 column, how if I want 50 column?

  2. Please see the picture for reference divsp.jpg

     

    I want to display all the divs as the picture (below section of picture). Here is my current codes :

    $top  = 30;

    $left = 10;

     

    switch($top) {    

            case $top < 100:

                for ($i=1; $i<=4; $i++)

      {

    $left = 10;

    $top  += 30;

              break;

      }

     

            case $top > 100:

    for ($i=1; $i<=4; $i++)

      {

    $left = 200;

    $top += 60;

                break;

    }

     

            case $top > 600:

    for ($i=1; $i<=4; $i++)

      {

    $left = 600;

    $top += 60;

                break;

      }

    }

     

    The result of code display the 1st div = $left = 10; $top  = 30; . And all the rest of divs are having the same $left = 600; but different $top  = 180; $top  = 300; $top  = 420; $top  = 540; $top  = 660;

     

    I don't know what's wrong with it. Can you give me some guide? Thank you.

  3. I'm no hero with CSS, especially positioning, but this seems to work:

     

    $top  = 0;
    $left = 0;
    
    while($userinfo = mysql_fetch_array($result2)){
        echo "<div style=\"left:{$left}px; top:{$top}px; position:absolute;\">{$userinfo['message']}</div>\n";
        
        switch($left) {
            case 0:
                $left = 400;
                break;
            case 200:
                $left = 0;
                $top +=35;
                break;
            case 400:
                $left = 200;
                $top +=35;
                break;
        }
    }

     

    I did test your switch case codes, it is not working. Sad.

  4. I use mysql to retrieve data from database and use php to display the data onto website directly by the following codes :

    $query2 = "SELECT message FROM messages WHERE username='{$username1}'";

    $result2 = mysql_query($query2,$connection) or die (mysql_error());

    confirm_query($result2);

    while($userinfo = mysql_fetch_array($result2)){

    echo "<div class=\"messagepiece\">" . $userinfo['message'] . "</div><br>";

    }

     

     

    I want the div(s) arrange style like on the picture http://2aek.com/inventory/divs.jpg

    display the 1st 4 divs onto 1st column, jump to 2nd column to display another 4 divs....

     

    Below are the codes of how the divs arrangement : 

     

    <div class="test1" style="left:0px; top:0px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:0px; top:70px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:0px; top:140px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:0px; top:210px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:200px; top:35px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:200px; top:105px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:200px; top:175px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:200px; top:245px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:400px; top:0px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:400px; top:70px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:400px; top:140px;">

    asdawdaw

    </div>

     

    <div class="test1" style="left:400px; top:210px;">

    asdawdaw

    </div>

     

    So the looping styles should be something like :

    loop left 0 for four times > 200 for four times > 400 for four times.

    loop top 0 > 70 > 140 > 210 then 35 > 105 > 175 > 245 then again 0 > 70 > 140 > 210.

    Seriously I don't know how to write the algorithm of looping.

     

    I guess the looping algorithm for left should be something like :

    i = 0 ; i=>4 ; i++{

    k=0; k=>20000; k+200{}

    }

    But it is so wrong, it will stop at 4th loop and each loop will be 0, 200, 400, 800. That's not what I want.

     

    Seriously I can't figure out the algorithm, my brain is stupid, so can you guys guide me please?

     

    [attachment deleted by admin]

  5. You actually need A, MX, and SPF dns zone records that identify your host's mail server as being the mail server that corresponds to your domain name.

     

    Something similar to -

     

    A    mail.your_domain.com = ip address of your host's mail server

    MX  20  mail.your_domain.com.

    SPF  - see this link - http://en.wikipedia.org/wiki/Sender_Policy_Framework

     

    Hello, professor, you know what? I spend lot of times to find out where to put the A, MX and SPF, I even google search and you-tube search where can i get that 3 things on my cpanel, but I can't find any, so I went to ask my hosting helpdesk about where to put the 3 things... Finally I get it done, it works like charm. I did blog about how and where to put the 3 things at http://ye5.blogspot.com/2011/03/avoid-phpmailer-send-email-go-to-junk.html

     

    I have other 2 questions :

    Question 1 : I not sure should I tick the checkbox of "All Entry (ALL):" on the Email Authentication page ?

    I saw this message *If you are sure you have entered all hosts (your primary mail exchanger and any other mx entries are automatically included) that will send mail for your domain, check this box to exclude all other domains.*

    If I tick it, will I lost some emails which outside people sent to my other domains that didn't listed on Email Authentication page?

     

    Question 2 :  I saw there are 4 options on MX Entries page :

        * Auto Detect Configuration.

        * Local Mail Exchanger

          If the lowest number mail exchanger points to an IP on this server the server will be configured to accept mail locally and from outside the server.

        * Backup Mail Exchanger

          If a mail exchanger other than the lowest points to an IP on this server, the server will be configured to act as a backup mail exchanger.

        * Remote Mail Exchanger

          If there are no mail exchange that point to an IP on this server the server will be configured to not accept mail locally and send mail to the lowest MX record.

     

    I don't understand what is mean by "lowest points to, configured act as a backup mail exchanger".

    I saw the "Remote Mail Exchanger" tooltips has the sentence "not accept mail locally and send mail to the lowest MX record". Is it mean I will lost some emails that send from outside people? If yes, I worry "Auto Detect" option will suddenly use "Remote Mail Exchanger" and causing I lost some emails.

     

    So, is it better I choose option 2 which is "Local Mail Exchanger" ?

     

  6. 1 - I am using phpmailer to send an email to a people without defining the $headers = 'From:" , so the From section of the email is showing default server aekcom@xen​on.sfdns.ne​t , the email didn't go to Junk box, I am so happy.

     

    2 - Then I apply $headers .= 'From: Pflik <admin@pflik.com>'; on the php mailer now. The email go to Junk box now. I am sad.

     

    My question : How do I change the default email server of my hosting aekcom@xen​on.sfdns.ne​t into admin@pflik.com ? If I can change it, then the email won't go to junk box anymore.

  7. $query4 = "SELECT * FROM shoping_cart where id = {$checkbox_value[$i]}"

    $result4 = mysql_query($query4);

    while($cart_list = mysql_fetch_array($result4)){

    $total_quantity = $total_quantity  -  $cart_list['quantity'];

    $updated_available_quantity = $cart_list['available_quantity'] - $total_quantity;

     

    let say check box has select 2 items - (two lists of wig and 1 list of pendrive)

    $total_quantity will add up all the 3 lists quantity.

     

    How to make the $total_quantity add up the quantity of wig and pendrive seperately?

  8. $checkbox_value=$_POST["selectlist"];

    for($i=0;$i<1;$i++){

    $query1 = "SELECT * FROM shoping_cart where reserve_id = {$checkbox_value[$i]} ";

    $result1 = mysql_query($query1,$connection) or die (mysql_error());

    confirm_query($result1);

    while($cart_list = mysql_fetch_array($result1)){

    $item = $cart_list['item'];

    $updated_available_quantity = $cart_list['available_quantity'] + $cart_list['quantity'];

     

    echo $updated_available_quantity . "-" .  $item. "<br />";

    echo $cart_list['available_quantity'] . "<br /><br />";

    }

     

    The output:

    89-Man Wig

    88

     

    94-Man Wig

    88

     

    My Problem

    how to make the output like below?

    89-Man Wig

    88

     

    95-Man Wig

    89

     

  9. Currently my this menu can only show but cannot hide. when I click on a category, it shows a list of items. When I click again the category, the list of items must hide back. How is the code to hide back the list of items? Could anyone help me? Thanks. I am newbie in PHP, so please show me the code in more detail. Thanks.untitled.PNG

     

    Below is the coding. Hope someone can help me modify it so that when I click 2nd time the category, it will hide the items. click 3rd time, it will show items. click 4th time, it will hide...

     

    function public_navigation($sel_category, $sel_item){

    $output = "<div style=\"overflow:auto; height:435px; width:250px;\" name=\"content\" ><ul class=\"categories\">";

    $category_set = get_all_categories();

    while ($category = mysql_fetch_array($category_set)) {

    $output .= "<li";

    if ($category["id"] == $sel_category['id']){ $output .= " class=\"selected\""; }

    $output .= "><a href=\"index.php?category=" . urlencode($category["id"]) . "\">{$category["category"]}</a></li>";

     

    if ($category["id"] == $sel_category['id'] || $category["id"] == $sel_item['category_id']){

    $item_set = get_items_for_categories($category["id"]);

     

    $output .= "<ul class=\"items\">";

    while ($item = mysql_fetch_array($item_set)) {

    $output .= "<li";

    if ($item["id"] == $sel_item['id']){$output .= " class=\"selected\"";}

    $output .= "><a href=\"index.php?item=" . urlencode($item["id"]) . "\">{$item["item"]}</a></li>";

    }

    $output .= "</ul>";

    }

    }

    $output .= "</ul></div>";

    return $output;

    }

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