Jump to content

thankqwerty

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thankqwerty's Achievements

Member

Member (2/5)

0

Reputation

  1. wait wait, maybe i'm wrong ....... ??? :-\
  2. Hi there, i wanted to make something like the commenting system in youtube, i.e. the users can click "reply" to a specific comment and a comment form pops out. I know how to make the comment form appear and disappear using javascript, but i'm not sure with having so many forms in the same page. my experience is that if u have 2 forms with elements that share the same name then the information would mess up, for example. <--? Form 1 --> <form action="comment.php" method="post"></br> Title: <input type="text" name="title" size="50"/></br> Comment: </br> <TEXTAREA type="text" wrap="physical" NAME="content" COLS=150 ROWS=10></TEXTAREA> </br> <input type="submit" value="submit"> </form> .. .. .. <--? Form 2 --> <form action="comment.php" method="post"></br> Title: <input type="text" name="title" size="50"/></br> Comment: </br> <TEXTAREA type="text" wrap="physical" NAME="content" COLS=150 ROWS=10></TEXTAREA> </br> <input type="submit" value="submit"> </form> Since both forms have "title" and "content" and when i submit something using form1, it will turn out to be empty data. This problem goes away if i name the elements in the 2 forms differently, but then it'll require different action page as the $_POST values have different names, even though the structure of data is the same. Is there anyway to get round this???
  3. Hi all, what would be the best way to make a treeview to show the structure of my website? Providing the information i need is stored on mySQL?
  4. so i just do it like normal generating html (using echo)?
  5. Hi all, i'm a newbie of javascript. I want to make a treeview showing the structure of my website using javascript. I would like to ask how can i pass the information from mySQL to javascript? Or do i just draw everything (the treeview) using PHP like normal, then expand and close each branch using javascript?
  6. Thank for the reply. In that case would it be better to use session? So i click something in the menu which pass the requested page to session, and i can avoid leaving a mess in the URL. But if i'm leaving the URL clean is that means i won't able to use mod-rewrite later (after i learn it ><!) to give each of the page a clearier URL. (i suppose if i use session all the link would appear to be main.php, instead of index.php or news.php or project.php). Is that mean if i'm going to use mod-rewrite later i should stand the mess in the URL for now?
  7. I have made a frame for my website, which contain some of the usual elements i.e. header, menu, .... etc. At the moment i program it in the following way. 1) The frame includes "header.html" (which contain the logo.... etc) and "menu.html" which are the same for all pages, then the contents for different pages i.e. index.php, news.php, projects.php .....etc 2) each page, for example the index page, i need to have a file for frame-index.php which combines header.html, menu.html and index.php. Then index.php to store the actual content of the idex page. 3) so i need 2 files frame-index.php+index.php for the index page, and the same for the project page and news page.....etc. And if i want to change the design of the frame i'll have to change each of the frame-XXXX.php files. Which doesn't seem very efficient to me. What would be the better way?
  8. Thank you very much for the reply. I'll read through it, though it looks like a bit tough for me at the moment. Would u tell me what is the advantage of doing this (since i see every major sites do it this way)? ???
  9. Hi, i'm trying to make a website that i can post articles and stuff. I managed to store the articles in my database and displaying them .... etc, which are all fine. At the moment i'm using $GET and php to generate the page with the desired article. The link to any specific article would be something like http://localhost/database/display.php?num=6. Where the articles themselves has no real link. So my questions are: 1) how can i make it like the BBC for example, where every page has a link to a real file? (should i create a html file everytime when a new article is posted) 2) if i create a new html file for every new article, what should i store in those files? Since all the information are stored in the database already. 3) is there any downside for what i have at the moment?
  10. I put in what you suggested. They both start with, <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); session_start(); ?> <html> "Lacking all your code to be able to duplicate the problem, my next best guess is a register_globals problem (variables of the same name overwriting each other.) What does a phpinfo(); statement show for the register_globals setting on each system?" I don't understand that, sorry i'm too noob.
  11. ok, i just put the two lines in but no different ??? :'(
  12. Just to make my problem clear, I run the same exact codes on a windows system and a linux system with the same version of XAMPP, but only the window one works. This is the 1st page where the session values are defined. I tested the variables in this page and they all work fine. <?php session_start(); ?> <html> <body> .. .. .. .. if ($redo != 0) { $_SESSION['redo'] = $redo; $_SESSION['username'] = $_POST["username"]; echo '<META HTTP-EQUIV="refresh" CONTENT="0;register.php" />'; } .. .. </body> </html> This is the code for the page that i have problem with. Where the value of session passed from the other page is lost. <?php session_start(); $redo = 0; if (isset($_SESSION['redo'])) { $redo = $_SESSION['redo']; if ($redo == 2) $usr = $_SESSION['username']; } $redo = $_SESSION['redo']; ?> <html> <body> <h1>User register</h1> <form action="checkinput.php" method="post"> <font size="4" face="Times"> User Name: <input type="text" name="username" value="<?php if ($redo == 2) echo $usr;?>"/> <?php if (($redo == 1)||($redo == 3)) echo " Sorry, the user name is taken.".'</br>'; else echo '</br>'; ?> </br> Password: <input type="password" name="pwd" size="50"/> <?php if (($redo == 2)||($redo == 3)) echo " Please input the password correctly.".'</br>'; else echo '</br>'; ?> </br> Comfirm Password: <input type="password" name="cpwd" size="50"/> </br> <input type="submit"> </form> </font> </body> </html>
  13. Hi all, I'm using XAMPP on my computers to setup a local server to test my code (both on linux and XP), I installed both at the same time (so the two should be the same version) i did not change any of the default setting. The problem is that my website contains a bit session, my code works perfectly fine on the XP system, whereas on the linux system the information that i store with session can't carry on to the other page. the php.ini file for my xampp of my windows system [session] session.save_handler = files session.save_path = "C:\xampp\tmp" session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 4 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" the php.ini session setting of xampp of my windows machine [session] session.save_handler = files session.save_path = /tmp session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_maxlifetime = 1440 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 1 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" any suggestion???
×
×
  • 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.