Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Everything posted by jimfog

  1. So Smarty is a template engine, not a framework?
  2. I recently read in an article in the web that a search box,it is recommended that it is 27 characters wide. When we say 27 characters wide do we mean that the size attribute(of the HTML input tag) is 27?
  3. jimfog

    session start

    I found this,related to the output buffering: output_buffering = 4096 Am I correct to assume that it is ON and that is the reason I do not get the error message? Yes, this was the reason after all I did not get the error-output buffering. Now I get the error.
  4. jimfog

    session start

    I have not made any adjustments regarding output buffering but just to be certain here are some code example, I want you to tell me if session startis positioned wrongly: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Appointmetns24x7</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/admingeneral.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" ></script> <script type="text/javascript" src="js/js-code.js"></script> </head> <?php require_once 'output_functions.php'; session_start(); $logout= '<li><a href="logout.php">Αποσύνδεση</a></li>'; ?><body> According to you, judging from where I have placed session_start, I should get an error. Correct?
  5. jimfog

    session start

    I just saw briefly the tutorial in php.net about setcookie-before proceeding and setting a persistent a cookie I want to make a question. According to the tutorial the function should be called before any output,meaning the cookie should be sent before the browser starts the output.So far I used a temporary cookie(session expired upon closing of the browser), I start the session with the function session start(which also sends a cookie to the browser), I place the function AFTER the head section of the site, nonetheless, so far I have not get any error message about the cookie being sent after output begun. Does this restriction about sending the cookie before the output holds only for the setcookie function?
  6. Is it easy to write a code example so I can grasp better this "template logic"? Thanks in advance.
  7. I have created a function that holds/outputs links such as logout, sign in... etc.Here is it: function output_header($username=false) {?><div id="header"> <ul id="headelem"> <li><?php echo $username ?></li> <li><a href="contact.php">Επικοινωνία</a></li> <li><a href="day.php">Calendar</a></li> <li><a href="login.php">Είσοδος</a></li> <li><a href="register_form.php">Εγγραφή</a></li> <li><a href="logout.php">Αποσύνδεση</a></li> </ul></div><?php} When called, the above li items will appear in the browser. My aim though, is that I want the logout link appearing ONLY after the user has signed(that is the logical thing to do, anyway) A scheme I have though is sth like that: function output_header($username=false,$logout=false) {?><div id="header"> <ul id="headelem"> <li><?php echo $username ?></li> <li><a href="contact.php">Επικοινωνία</a></li> <li><a href="day.php">Calendar</a></li> <li><a href="login.php">Είσοδος</a></li> <li><a href="register_form.php">Εγγραφή</a></li> echo $logout </ul></div><?php} Where logout will be replaced by the li item, which will be a string as an argument of the function. What do you think about the above? Do you have to propose anything better?
  8. jimfog

    session start

    Ι read this thread, not all of it, just the section about the "remember me" functionality-the article is very good but it only deals with the theory. I need to know(coding, functions...etc) how am I going to set a persistent cookie in the user's browser so-as stated above-he will be automatically login as he visits the site.
  9. jimfog

    search box

    I did, all the required coding, onfocus and onblur, thanks.
  10. I somehow understand what are you talking about...but it surprises me though. You are saying, in other words, that the function document.ready,after the DOM loads, the content in it is "useless"...correct? As I remember,from past experience, code inside the document.ready function, stills works after the DOM loads.
  11. I do not understand exactly what are you trying to say.You say: What do you mean by saying now function, and as I say, outside of document.ready function, the print function I made, does work. Some clarification is needed.
  12. I have attached in an html input/button tag an onclick event which points to js function that prints the page: <li><input id="prntbutton" type="button" value="print" onclick="printpage()" /></li> here is the function: function printpage(){ window.print()} The problem is that if I put the function inside the outer document.ready function that is used with jquery code, the print function does not run: $(document).ready(function() {function printpage(){ window.print()}}); Why that? Is the reason,maybe, that document.ready "accepts" only jquery function/code?
  13. jimfog

    session start

    You said "when the browser closes". Does the above include also, when the tab closes?
  14. jimfog

    sign up form

    Sorry for the naive question. Is the term sign-up form another way of saying register form?
  15. jimfog

    search box

    I am not talking about the case where you use the tab key, but about the case where you go the mouse cursorover the input element and then press the mouse click button. Is the above considered also onfocus?
  16. jimfog

    search box

    So, you are saying that despite the user clicking on the search box is NOT a click event but an onfocus/onblur event.
  17. jimfog

    search box

    In modern web design, in websites, I see that the search boxes have text in them, text thatgives a hint to the user as to what he can search for. You can see that in facebook for example, in the search box it says "search for friends,places, things...."., As I know the above(this "search for friends,places, things....".,) is the result of the value attribute of the input tag. What I want to know is how can adjust the behavior(regarding the text that appears in it) of the search box upon the user clicking there.At the w3schools site when you click inside that search box, the text/value(search w3schoools.com) is gone. Is this achieved with javascript or can be done with css to? Obviously we are talking here about an onclick event Thanks.
  18. jimfog

    session path

    In other words, you are saying(and correct if I am wrong) that session ID gets stored BOTH in the cookie AND as a name of a file in the serverwhere the session data is stored. And somehow, when a visitor(registered) comes in the site, PHP associates the session ID in the cookie with the file in the server. Correct?
  19. jimfog

    session path

    Right, normally stored in URL-encoded fashion like a query string. Oh...yes you are right,developing the application locally I forgotten that a server runs in my machine. Then...what gets stored in the cookie(if the session ID file holds the contents of $_SESSION array ) and where am I going to find it? I know that the cookie gets stored in the user's PC.Is it stored in the browser?
  20. jimfog

    session path

    Regarding the session data, you mean the value(s) that are stored in the $_SESSION array?I think that session data were supposed to be stored in the server.And another question. Does this file gets created every time the visitor(the registered one) comes in the site?
  21. jimfog

    session path

    I have set a directory in my localhost(a location in my HDD) as session.save_path. In that location i see files such as sess_ubhgs6me9p1l4j2h1rci2mal15. Does the above file hold the session ID of the visitor -which is unique?
  22. jimfog

    session start

    I did not proceed with the "remember me" functionality. I just want to see first that set_cookie_param works OK. This what I did: session_set_cookie_params('4800'); session_start(); It does not work though, I am not surprised , I know that something is missing. I must stress that the above code is found in the member.php file which is the page the user is taken AFTER he has filled in correctly his details(username, password)and in which page I want the user automatically be directed there if he is already registered. The first page, where the login form is, is called index.php,the goal is, that if a registered member user comes to the site, this page is skipped(a very typical scenario in the web today). So, what do you think? How I must proceed?
  23. jimfog

    session start

    Ok, session is working-as already stated. The problem is that the session does not work when a returning visitor comes-I mean when in this site for example a visitor who is already registered comes, he is automatically logged in. How am I going to achieve this using session functionality? Do I need maybe an if statement code?
  24. Take a look at the code below: function output_head($title=false){?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php $title ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/admingeneral.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" ></script> <script type="text/javascript" src="js/js-code.js"></script> </head><?php} I have enclosed everything related to the head section in a function-which of course I am calling at some webpage of the application(not shown here). So, it is OK doing it this code or maybe is it better if the head section does not go in a function?
×
×
  • Create New...