Jump to content

Drongo_III

Members
  • Posts

    579
  • Joined

  • Last visited

Posts posted by Drongo_III

  1. Hi Dan

     

    Thank you so much for your response! I think I am finally starting to understand how this works in practice and how to set things up correctly.

     

    What sparked my question was a client who wants me to host their website but  have their own mail server and want to keep the mx records as they are. And this got me wondering how well i understand this and whether i actually need to amend the zone file for the addon domain everytime or not (which i now realise i don't). 

     

    The thing is there are lots of guides on dns - "what are name servers", "what does @ mean" etc. - but a discription of the elements that make up dns feels like a long way from how all the component parts work together in the real world when you have domains hosted with one company and a server for web space hosted with another. I shall keep reading up on it until i've fully cracked it but you may yet be bombarded with more questions on this hehe ;)

     

     

     

    More from Zoe:

     

     

     

    If you are running cPanel, I highly, highly recommend, both for your sanity and the sanity of any support personnel who access your server, that you use cPanel's integrated nameservers.  Simply point the NS records from your registrar to your cPanel box, and let cPanel handle all your domain records.

     

    If your mail is handled by cPanel, your MX records are automagic.  They just work.  Add subdomains?  Just work.  Add SPF or domainkeys?  Just work.

     

    You then manage your DNS records in cPanel under the "Simple DNS Zone Editor" or "Advanced DNS Zone Editor."  The zone editors check your records for sanity, so your nameserver won't fail due to malformed records or anything.

     

    Because you're running cPanel, you have a nameserver running ANYWAY, managed by your panel, so I highly recommend you use it unless you have a very specific reason to avoid it.  One final pitch (as a professional support technician) your support tech will appreciate having all records handy in case of repair... and you'll appreciate not having to play go-for between support and your registrar when (not if, it's DNS, this stuff happens) things change.

     

    WITH ALL THAT SAID, I hate when people don't answer the question I ask, so in answer to your question, your checklist in your followup question is technically right and will work.  Re scenario two, no;  if you point your NS records to your VPS they will automatically work (after 24-72 hours as the DNS catches up it's caches) because cPanel manages them (see my overly wordy sales pitch above).

     

    The biggest thing to know about DNS is that there is one-only-one authoritative nameserver.  All other nameservers have NS records which point to the authoritative nameserver.  You just need to pick which server is the authoritative nameserver, and make sure all others point to it.  It can be any server you want, but with cPanel it's best to use the built in one for sanity's sake.

  2. Yes. Just check if the variable is empty and if so then set it to be NULL. But make sure you use double quotes or it will end up being inserted as the literal 'null' rather than null (without quotes).

     

     

     

    Ok i seem to be having difficulties  if i dont want to enter data into a field in a mysql table do i juts put NULL in the sql query ?

  3. Ok so here is my follow up question (sorry it is so long).

     

    Lets say my domain is hosted on 123 reg, and as above, I have my own vps server (with cpanel, whm) where i host my websites.

     

    So if i want to set all records in 123 reg am i correct in doing the following and is my understanding correct?

     

    [*]Change the A record (www and @) on the domain (on 123 reg) to point at my vps server where an addon domain is setup for it

    [*] keep the nameservers set to 123 reg (so this is the main authorative name server where dns lookups are made)

    [*] Setup the mx record on 123 reg - because this is where the dns system will look for my mx record with nameservers set to 123 reg

     

    Does that all sound correct?

     

    If so then here's scenario two:

     

    Am i right in thinking that if i change the name servers on 123 reg, so that they are now set to my own vps server's name servers, that i now need to setup the zone file on my own server for MX, WWW, @ etc. because now dns lookups are routed to my server instead of using 123 reg? Is that correct?

     

    If so i think the penny has finally dropped and i understand the distinction.  If not, please tell me where i am wrong :)

     

    I am really keen to understand this as i operate on my own so  i don't really have anyone to bounce this off and if i don't understand it then i might inadvertently make a mistake :/

     

    Many thanks,

     

    Drongo

     

  4. Thanks very much Dan! It's a bit of a confusing world when you get down to the nitty gritty of dns. I might well post a follow up question but don't worry if it's not your bag. Thank you very much for the info you have provided - it has helped me uderstand a bit more. :)

     

    It depends on where the actual nameservers exist.

     

    If you are using the nameservers at your registrar, you need to put your MX record on the registrar;  placing them on your server will do no good.  As long as your mail exchanger information doesn't change, you don't need to edit the MX record at the registrar unless you change mail hosting.

     

    If, however, your VPS contains a nameserver (like if you are running cPanel), then you need to point the nameservers to your VPS at the registrar.  You then put your MX record in your cPanel zone file.  If you ever move nameservers to another server, you will need to move your MX record to the new server as well.

     

    It's an either/or.  Domain names can (pretty much) only have one authoritative zone record (you can be on multiple nameservers, but that record better completely match on all of them or else really weird name resolution things happen), so you need to decide exactly where it will live and make sure your NS records at your registrar point there.

     

    --The above was written by my friend Zoe, a linux tech and network tech at HostGator.  I don't know anything about this topic, but I knew she did.  I probably won't be able to do any follow-up answers.

  5. I hope someone can help me understand this.

     

    I have about enough knowledge of DNS to get by but there is something I am a tad confused by.

     

    I have a vps server. If i point a domain hosted by a third party at my server using my name servers I then have to setup an mx record on the zone file (on my server) for email to work - even though the mx records are setup on the domain in the domain control panel (on 123 reg).

     

    So am i right in thinking that everytime i point a domain at my server (which is setup as an addon domain) I need to also add the mx records into the zone file on my server?

     

    Do the mx records on the domain host simply become obsolete when you repoint the name servers?

     

    Any help in understanding this would be massively appreciated because i feel rather dumb for not quite grasping this... :/

  6. I can;t see how sessions can work for this either. Since the company need to respond, presumably at a later date and from different computers.

     

    Probably best to store each stage as and when it happens and maybe add a field on each record with a flag for status - i.e. "awaiting company response", "awaiting user confirmation" so you can run a check to see the status of the record.

     

     

     

    Im making a application but many users can access it at the same time, also the data that needs to be stored into the database in 3 parts firstly the user will enter some details the comany will fill out the reamining details and the user will then accept or decline the companies proposal. The issue im havign will it be easier to just store all of this information into session variables and then save them into the database at the end when all of the details are ready ?

     

    Thank You

  7. As i said, i'm not fully following what you are trying to achieve. if you post your code with a more indepth description might be able to come up with something better :)

     

    Drongo_III, putting a background color would solve this issue, however, the whole page background is an image, so that is not an option :(

  8. Hi mate

     

     

    I am assuming your queries actually work. If so, here's the script to generate the links with the IDs. Typing this off the top of my head so sorry if there are any errors.

     

    
    $result = mysql_query("SELECT * FROM topics");
    
    while($row = mysql_fetch_array($result))
      {
    
      
      echo '<a href="/YourScript.php/?id=';
      echo $row['id'];
      echo '">' . $row['topic_subject'] . ' </a>';
      echo "<br/>";
      
      }
    
    

     

    You need to change YourScript.php to whatever script the user will be directed to in oder to generate the content. But this should generate a list of topics with the links dynamically created from the IDs in the database.

  9.  

    You would most likely use the query strings and $_GET[] to identify the topic you want to pull out from a database (in this instance).

     

    So depending how you separate your code you would use the $_GET[] on whatever page processes the DB query and displays the content.

     

     

    So on one page you might generate a list of anchor tags like

     

    
    <a href="/SelectedTopics.php?id=20"> Go to topic 20 </a>
    
    

     

    When a user clicks that linkt they'll go to the Select.php and the in the address bar there will be the querystring on the end of ?id=20

     

    So your script would then do something like :

     

    $id = $_GET['id'];  // Here you assign the query string that is stored in the $_GET array to a new variable name - $id
    
    

     

    Then you run a database query using that ID  and generate your content.

  10. $_GET[] is a built in array.

     

    You generally set the $_GET[] in one of two ways. Either through a web form with method="GET" or via a query string.

     

    So if you had a script and want to pass in some data via a query string you might do:

     

    Yourfile.php?id=32;

     

    The query string is everything after the ? That gets placed in the $_GET[] array by default.

     

    You can then access that array by using:

     

     

    
    $variable = $_GET['id'];
    

     

    You could of course have multiple parts to the query string like Yourfile.php?id=32&de=43

     

    So you could access multiple variables from the GET array.

     

     

    Query strings are very handy for passing in parameters for like the ID of a page or a piece of content. Look at the url of this site and you'll see things like topic=350294.0.

     

    So your script could then do

     

    $tipic = $_GET[topic];
    

    So the variable $topic is now set as 350294.0 and as your script now has access to this you can use it however you like - most likely in a query on the database to pull that particular article.

  11. Hi Kleb

     

    Your tables should be setup so that both the USERS table and the CONTENT table share a common id. So in your USERs table 'Bill' might be ID 1.

     

    Bill has created  a topic and content that is stored in table 2. So this would have three columns like so: id 1, Topic, Content

     

     

    Then you run a statement along the lines of the following (which is a very simplistic example). In the example 'Content' refers to your content table and Users refers to your users table.  The query looks for a common id in both tables and joines the data when an id match is found so it's all accessible as one row.

     

    
    $result = mysql_query("SELECT * FROM Content, Users WHERE (content.id= user.id) ");
    
    while($row = mysql_fetch_array($result))
      {
      echo $row['id'] . " " . $row['name'] . " " . $row['topic'] . " " . $row['content'];
    
      echo "<br />";
      }
    

     

    Hope this helps!

     

     

     

  12. You can do a time stamp just by going into your database on php myadmin. Then add a column to the table and in the drop down for 'type' (that's the dropdown with VARCHAR, INT etc.) there is an option for DATE and TIME.  You can select various variations on the date and time from the drop down. Then everytime a record is added to the database it will automatically add the current date and time to that field. So you don't have to do it.

     

    You can then retreive the date and time as you would any other database value.

     

     

     

    how do i use the time stamp..do i write it together as in TIMESTAMP?

  13. Shoot me down if this is an overly simplistic suggestion...but could you not just use 'Time stamp' as one of your mysql  table columns? This would then save you having to do all the date processing to create the date.

     

     

     

    i have been trying to insert date with when users post there comment but when i echo the date() with the comments..it just display 0000.00.00.00 just like that and when i checked my DB it was like that too..please what can i do.this is my code

    Thankd in advance

    <?php
    include"header.php";
    if(isset($_POST['submit']))
    {
    $postdate=mktime(0,0,0,date("m"),date("d")+1,date("y"));
    $comment=mysql_real_escape_string($_POST['comment']);
    if($comment!=='')
    {
    $ins="INSERT INTO post(post_content,post_date)VALUES('$comment','$postdate')";
    mysql_query($ins) or die(mysql_error());
    }
    else
    {
    echo"You can not post an empty page";
    }
    }

  14. Well they'd all be in the same row so yes.

     

    So you'd have

     

    ID

    Topic

    Content

     

    Keep in mind this is an extremely simplistic example and you may benefit from having multiple tables and structuring it more clevely if you plan to scale this to hundreds of recrods. But if you just have a handful and it's finite then it should be ok to do this.

     

    :)

     

     

    but will i be able to link the a TOPIC from the TOPIC column to the CONTENT in the CONTENT column?

  15. Yeah not quite following what you're getting at. Code would help.

     

    Otherwise if you want to just make it so you can't see through the div you could set a background colour on it...

     

    But i'm not usre that's what you're trying to achieve.

     

    Hi guys,

    I have a background image, and then a fixed div.

     

    My issue is when i scroll the page, i can see the scrollable content underneath the fixed div (transparent background, because of whole page image background).

     

    How can I make the scrollable div content not viewable behind the fixed div?

     

    Any method, css, jquery, PHP, is appreciated, cheers in advance.

  16. OR you could dumb it down still further just to test it and do

     

    
    if(empty($_POST['loginname']) && empty($_POST['loginpass'])) {
    
    echo "Display form";
    }
    
    
    else{
    
    echo "process form data";
    }
    
    

     

    I suggest this because sometimes white space can mean a var isset even when it's not

  17. Try add the following before you echo:

     

    $reminders= count($reminders);
    
    

     

    I tried double quotes, but I'm still missing something

     

    
    
    
    
    
    <?php echo ((count($reminders)) > 0) ? "<span id=\"reminder_counter\" class=\"menu_number f_right mrm\"> {count($reminders)}</span>" : ""; ?>
    

  18. sorry change postID to just ID.

     

    So

     

    $id=$_GET['id'];

     

    Why are you still trying to join the tables?

     

    help it gave me an error

    Notice: Undefined index: postID in C:\wamp\www\topic_content.php on line 3

     

      <?php
    include"header.php";
    $id=$_GET['postID'];
    $sql="SELECT* FROM post JOIN topics ON postID=topics.topicsID WHERE topicid='$id'";
    $result=mysql_query($sql)or die(mysql_error());
    while($row=mysql_fetch_array($result))
    {
    echo "{$row['post_content']}";
    }
    

  19. Ok.

     

    so you have two tables.

     

    Table 1 contains rows with - ID and Topic Name

     

    Table 2 contains rows with - ID and Content - the ID here should match with it's counterpart in the Topic table.

     

    Your topics page generates a list of links all of which have a query string (i.e. ?id=postID).

     

    The user clicks that link and gets directed to the contents.php page. Because the links have the query string you pull that from the GET array - i.e.

     

    $id = $_GET('id')
    

     

    You now know the topic the person has clicked on and you have the ID of the topic which should match the ID of the Content tables -therefore you know the content you want.

     

    
    
    
    $result = mysql_query("SELECT * FROM Contents
    WHERE id=$id")
    
    while($row = mysql_fetch_array($result))
      {
      echo $row['Contents'] 
    
      }
    
    

     

    Somethng like that...

     

    This is assuming that you have two tables which is what I thought was the case from the start...

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