Jump to content

xenophobia

Members
  • Posts

    299
  • Joined

  • Last visited

Posts posted by xenophobia

  1. I am seeking for advise on setting up the SMTP for my websites.

     

    I have two servers. One is mail server and another one is web server.

     

    I have more than one website in the web server.

     

    All email accounts are stored in the mail server.

     

    On my website, I have many enquiry forms. Some on the same domain some on different, but same server.

     

    These forms will send an email to the site owner once user submit the form.

     

    My questions:

    1) Should I configure my script to use the mail server as a relay to send out email via SMTP? Because as I know, if I use the sendmail program in the web server, email that goes out will categorized as spam.

    2) If Q1) is YES, should I create one account for each domain? Because I have multiple domain hosted on both server. So each website will use the assigned account to relay email.

    3) Is it possible to configure my mail server to whiltelist my webserver so that it allowed it to connect via SMTP without authentication and allowed to set the sender's email differently? If possible, which setting I should look into? EG: SPF.

     

    This is a conceptual question. So no hardware or software restriction. I just need some guide on where I should look into it.

     

    Thank you for reading!

  2. Errmm there are many ways to do it.

     

    1st:

    Two queries. First query is to store all country's ID and loop it. Then from the country ids, you yield the cities name based on the country's ID.

     

    2nd:

    Loop the result set you have, store them into a multidimension array. Eg:
    [

      "uk" : [

        "liverpool",

        "london"

      ],

      "germany" : [

        "..."

      ]

    ]

    Tips: you can use the "isset" function to check whether the array key is exists. From the array list, then you can print them in the desired order.

  3. Your onclick event code doesn't look like having any problem.

     

    I believe it was your php code. Try load the page and view the source, look for the line. Because sometime if PHP throw an error inside the HTML tag, you can't view it on your page. Verify the PHP code before troubleshooting your javascript =)

  4. Hi, I've been searching on this scripts or plugin for website. I have no idea what you call it. I can only explain how it's look like. Here we go:

     

    Just like <map> in HTML, user can click or react with an image on certain position or shape. When a user mouse over a certain part of the image, I want another picture with few wording popsup. Eg:

    A world map picture is displayed on a web page, when a user mouse over a country, the entire land will be highlighted, and a small image box will come out and show the country's flag with the name of the country.

     

    This is just a simple scenario, i am looking a framework that can actually implement on many purpose. Wonder if there is anyone know about this kind of framework?

     

    Thank you!

  5. What do you mean by include web.config file in my project ? As I mentioned, I am running Joomla! CMS on my IIS 7.5 server. The web.config file is basically used for my URL Rewrite which produce a search engine friendly URL (SEF URL).

  6. Hi,

     

    I having a strange problem where out of sudden, my sub-pages was not running and shows up error 404, page not found.

    Note, it only happened on my sub-pages but not homepage. Meaning www.domain.com/site1 no problem, but www.domain.com/site1/subfolder will cause the error.

     

    How I fix it is very weird. I just go to C:\Inetpub\www\site1, rename the web.config to web1.config. Then rename it back to web.config, then my subpages works back. It doesn't matter what you rename, as long you did some changes on the web.config, it will work fine. How is that possible ?

     

    FYI,

    • IIS 7.5
    • Joomla 1.5
    • MySQL 5
    • PHP 5.2

    So my web.config is to enable the SEF URL for Joomla. So far I can't find any pattern that trigger this incident. Just wonder if there are anyone facing the same problem with me?

  7. As I said, there is no way to get external source page's height. What you can do is, create a PHP file as a proxy to the external source.

    Eg: http://www.yourdomain.com/load_external_source.php

     

    In your code:

    <?php
    if (isset($_GET['url'])) {
    $url = urldecode($_GET['url']);
    $html = file_get_contents($url);
    echo $html;
    }
    ?>
    

     

    So you can query external source using local domain:

    http://www.yourdomain.com/load_external_source.php?url=http://abc.com/navigation/74550.cms

    With that, the page will be loaded and now your javascript can get the height of the content. Please try out, cheers  :D

     

     

  8. Well, it started when I've developed a socket server using PHP. Currently I use the command line below to start the server:

    php -q Server.php

     

    So I want it to be installed on the server as a service. So I can do something like this:

    service MyPHPServer start [Linux]
    sc start MyPHPServer [windows]

     

    So far I've got this which is using cmd to launch a batch file and the batch file will start the server:

    C:\Windows\System32\cmd.exe /c C:\my_service_path\startup.bat (I've tried only in Windows)

     

    Then I put this line in my batch file (assumed the php file is located same directory as the batch file):

    php -q Server.php

     

    It was added to the service registry. But when I tried to start it, i got a message:

    [sC] StartService FAILED 1053:
    
    The service did not respond to the start or control request in a timely fashion.

     

    I know this is not the way, just wonder anyone tried to start a PHP file as a service before and share their experience.  ;)

  9. Suppose you got a select element:

    <select onchange="optionChanged(this);">
      <option value="1">Option 1</option>
      <option value="2">Option 2</option>
      <option value="3">Option 3</option>
      <option value="0">Other</option>
    </select>

     

    And a input box:

    <input type="text" id="txtBox" size="30" style="display: none;" />

     

    Now, put these codes in your header:

    <script language="JavaScript" type="text/javascript">
    function optionChanged(ele) {
      var val = ele.options[ele.options.selectedIndex].value;
      if (val == 0) {
        document.getElementById("txtBox").style.display = "block";
      }
    }
    </script>
    

    So when you select Other, the textbox will appear.

  10. This is depend on how you draw your table. Are you using PHP? Probably your code will loop all the message and print it out on a table's row.

     

    So what you have to do is append the record's ID into each row. So each row you will have a different ID:

    <tr id="row_1">

    ...

    </tr>

    <tr id="row_2">

    ...

    </tr>

     

    With that, you can loop all the row and get the content in JavaScript:

    for (var i=1,limit=100; i < limit; i++) {

        var row = document.getElementById("row_" + i) {

            if (row === null) {

                alert("End of row: " + i); break ;

            } else {

                var text = row.innerHTML; // Here is your text.

            }

        }

    }

     

    This is just the concept, actually implementation has to depends on you. =)

  11. To get the content inside a HTML, use document.getElementById("youElementId").innerHTML

     

    Eg:

    <div id="element1">Hello world!</div>

     

    <script language="JavaScript" type="text/javascript">

    var text = document.getElementById("element1").innerHTML;

    alert("Here is your text: " + text);

    </script>

     

    So you just need to give an ID to your element and grab the content by using innerHTML property.

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