Jump to content

freebsdntu

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Posts posted by freebsdntu

  1. the main reason is that you need double quotes to evaluate the caharacters.  if you user "hello world \n"  that will work because it will pringt a new line isntead of a "\" and a "n"

     

    gdlk

    This sounds rationale, but what if I do it like this : 'Hello Word"\n"', it still does not work.

    I guess I need to check with the escape characters. Since I would have "" symbols inside "" of echo

  2. Hi,

     

    Im glad to help you, and you should take away your "\n" thats why it is appearing, just leave it:

    echo 'Hello World!'

     

    Im glad for helping you,

     

    if i had solved your problem, mark this thread as solved please

    Thank you for your help, but the problem is not solved, i have a series of echo statements, if I remove \n, then there won't be carriage returns.

  3. Thank you very much for your kind reply,Daniel0. It is very helpful to me.

    What I intend to do is do it in a modular fashion, with MVC pattern, ya, but I don't want to try the template engines like cakephp, smarty, etc. I would to create one on my own, also to cater for my own needs.

    Ok, let's say, in my template, there will be head section, menu section,sidebar section,main content section,footer section,etc,what I am trying to do now is to build a separate .tpl file for each section, but with customizable functionality, i.e. when applying the template head, I shall be able to specify the title of the page.

    What do you think of my approach? Any suggestions? It is still in my mind, I haven't have clear thoughts how to realize it in codes. So inputs would be greatly appreciated! 

  4. That help:

     

    <?php
    #connect to MySQL
    $conn = @mysql_connect( "----", "----", "----" )
    or die( "Could not connect" )
    #select the specified database
    $rs = mysql_select_db( "votick_banner", $conn ) or die (mysql_error());
    ?>
    

     

    connection is succesful. I added teh database after.

     

    Try to add a ";" after your first die statement.

     

    <?php
    #connect to MySQL
    $conn = @mysql_connect( "----", "----", "----" )
    or die( "Could not connect" );
    #select the specified database
    $rs = mysql_select_db( "votick_banner", $conn ) or die (mysql_error());
    ?>
    

  5. Any reason why never use @? I use @ sign in this situation, it works fine.

     

    I suggest you post the banner.php,Vivid Lust, according to the error message,something is wrong on the 6th line.

    Also, did you do correctly with the database connection setup? Is your $conn successful? Just my 2 cents.

  6. Hi guys, I would like to write a template for my personal site, because as I am expanding the site, I find it tedious to correct for each page whenever I make a small change. Any suggestion on where should I start?Thank you very much!

  7. $query = "INSERT INTO `order` (type_service, notes, agree, time) 
    VALUES ( '$type_service', '$notes', '$agree','NOW()');"; 
    

     

    Hi, try this,remove the ' ' surrounding NOW():

     

    $query = "INSERT INTO `order` (type_service, notes, agree, time) 
    VALUES ( '$type_service', '$notes', '$agree',NOW());"; 
    

  8. Check out the sticky on normalization and the dev article inside on storing hierarchal data.

    Thank you for your reply,fenway,I have browsed through some articles on storing hierarchical data, it is too much complicated, when applied to my case, i mean. So is there any other approach? Maybe I should have asked whether would my design work.

  9. Hi guys, I am designing a database schema for project, where ptitle,pobjective,etc are the attributes.

    A project might have series of sub-project, and this sub-project might have its own sub-projects, and it goes on like this. If I want to easily list the hierachy of all the projects, what should be the shema look like?

    Ok, the shcema I am thinking of now is like this:

    I inlclude a super-project id field, where it is set to 0 if the project does not have any super project, and it is set to the project id of its direct parent project if it is a sub-project of some project. The problem with this design is I don't know how to list the hierachy.

    Any hints on the schema? Thank you very much!

  10. This can be done easily in javascript,do a simple google search.

    Anyway,this is my code,just as a pointer

    html

      <select name="select" id = "link">
        <option value="#">Sort By...</option>
        <option value="0">All Members</option>
        <option value="1">Username</option>
        <option value="2">Last Online</option>
        <option value="3">Online Only</option>
        <option value="4">Offline Only</option>
      </select>
    

    javascript

    function goto()
    {
        var link = document.getElementById("link").value;
        window.open(link);
    }
    

  11. Oh,sorry,I got it wrong,that warning came because I output something before calling session_start() in the file before redirection.

    But another problem I discovered is that if I invoke methods like $user -> getUsername(), it returns empty string, is this the problem with the $user object?

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