Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Posts
    237
    Thanks
    11
    Thanked 5 Times in 5 Posts

    How would i do this?

    Hi guys

    Just a little advice on how i can achieve this...

    Basically i am building an admin panel for my sisters business website which is easy enough.

    I am wanting to post a message every now and then to people i have built a website for.

    I would like to be able to input the message on my websites admin panel and it to show up on other peoples website admin panels

    For instance.

    "Your website will be down for 1 hour while upgrade to server is being made".

    I was told rss is the best, but i do not know anything about rss as i am new to web development and php.

    Has anyone any ideas how i can achieve this.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    A couple of ways to do this ...
    Since you have full access to both websites, you can choose to either
    put the "site down" condition on your site, or the other sites.

    Example,
    On your sister's site, you have a tiny script that merely checks for the
    existence of a file on your website. If the file exists, you display a "closed" message.
    You include that script on the top of her "index.php" page, or all pages.

    When her site needs to close, you create a file on your website called,
    sistersite_maintenance.txt ... The file can contain anything ... it just needs to exist.
    You could even use an image: sister.jpg (or something like that).
    When her site is available again, you simply delete that file on your website.

    You can use fopen() unless disabled by your webhost, otherwise CURL:
    http://www.kirupa.com/forum/showthre...-server-exists


    .

  • #3
    Regular Coder
    Join Date
    Oct 2011
    Posts
    237
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by mlseim View Post
    A couple of ways to do this ...
    Since you have full access to both websites, you can choose to either
    put the "site down" condition on your site, or the other sites.

    Example,
    On your sister's site, you have a tiny script that merely checks for the
    existence of a file on your website. If the file exists, you display a "closed" message.
    You include that script on the top of her "index.php" page, or all pages.

    When her site needs to close, you create a file on your website called,
    sistersite_maintenance.txt ... The file can contain anything ... it just needs to exist.
    You could even use an image: sister.jpg (or something like that).
    When her site is available again, you simply delete that file on your website.

    You can use fopen() unless disabled by your webhost, otherwise CURL:
    http://www.kirupa.com/forum/showthre...-server-exists


    .
    Thanks for the reply and help!

    The message to their admin panel would be to warn the person what is happening.

    Eventually when i get better with coding i will start taking clients and use it to remind invoice is due etc.

    Can this method still work for just a message.

    For instance.

    If txt file exists in www.domain.com/file.txt read message and tell client, if not then do not show.

    So which is best method out of the suggestions you have said.

    Thanks

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    Sure ...
    You can create your own API (Application Programming Interface) that the other sites will access and process before opening pages.

    I sort of like the API method because you can give the other people a token key,
    and then, when the script is called, you'll know which site is requesting their status.

    Let's say you have an invoice type of system that detects my payment is due.
    You add that to a MySQL table. When my admin panel opens, it calls your API
    and your script sends me back a message that my payment is due.

    I would include a small script at the top of my admin page that uses CURL
    to request data from your site using a URL like this, or an XML request ...
    http://www.yoursite.com/status/check...XRE524FG8H942S
    The response I expect back is an XML response ... that I can parse out the message.

    Your script called "check.php" sees my token key and queries your database.
    If it sees a pending message, it sends back an XML response.

    I looked for an easy API tutorial ... this one is from 2005, so it's sort of old:
    http://www.codewalkers.com/c/a/Misce...wn-Custom-API/

    Maybe someone else has a newer PHP Class or method to make handling easy.

  • The Following 2 Users Say Thank You to mlseim For This Useful Post:

    devinmaking (11-28-2011), dnnhater (11-28-2011)

  • #5
    Regular Coder
    Join Date
    Oct 2011
    Posts
    237
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by mlseim View Post
    Sure ...
    You can create your own API (Application Programming Interface) that the other sites will access and process before opening pages.

    I sort of like the API method because you can give the other people a token key,
    and then, when the script is called, you'll know which site is requesting their status.

    Let's say you have an invoice type of system that detects my payment is due.
    You add that to a MySQL table. When my admin panel opens, it calls your API
    and your script sends me back a message that my payment is due.

    I would include a small script at the top of my admin page that uses CURL
    to request data from your site using a URL like this, or an XML request ...
    http://www.yoursite.com/status/check...XRE524FG8H942S
    The response I expect back is an XML response ... that I can parse out the message.

    Your script called "check.php" sees my token key and queries your database.
    If it sees a pending message, it sends back an XML response.

    I looked for an easy API tutorial ... this one is from 2005, so it's sort of old:
    http://www.codewalkers.com/c/a/Misce...wn-Custom-API/

    Maybe someone else has a newer PHP Class or method to make handling easy.
    Thanks for the input, you have been very helpful.

    Ive never done a api before so this will be fun... OR a headache lol.

    Cheers


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •