Jump to content

I have some questions


Recommended Posts

1) Have you ever see this case, you click submit button in a page and the action attribute in Form tag link to that page alsoexample.php

............ action='example.php'........

2) How can I create a new php page after ... for e.g click a button ?3) Justsomeguy had given me a link explain for this, but ... I am lazy to read the whole :) text varchar(N)what is the maximum of N, N=30 then we have maximum 30 words for string "text" ?4) how can we put a stylesheet, meta tags ... in an php fileindex.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><link rel="shortcut icon" href="favicon.ico" /><title>W3Schools Forum -> Posting New Topic</title> <style type="text/css">	html{	overflow-x: auto;}</style><?php...?>


<?phpecho "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xml:lang='en' lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='content-type' content='text/html; charset=iso-8859-1' /><link rel='shortcut icon' href='favicon.ico' /><title>W3Schools Forum -> Posting New Topic</title> <style type='text/css'>	html{	overflow-x: auto;}</style></head><body>...</body>";

thanks !!!

Link to comment
Share on other sites

To submit to the same page, use a hidden form element to tell the next page what to do.<form ...><input type="hidden" name="page_mode" value="add"></form><form ...><input type="hidden" name="page_mode" value="delete"></form>Get the page_mode variable on the next page and check what it is to decide what that page should do.For a varchar field in MySQL, the number is the number of characters that are allowed. Max for varchar is 255 characters.About the general question about writing out HTML, I prefer to use include files for large blocks of HTML or stuff that will be repeated, like headers and footers and menus. I have my own template system where I use template files with large blocks of HTML in them, it keeps the HTML and PHP code separated. You can wrap all the HTML in a PHP string and have PHP echo it out, but that HTML is not as easy to maintain. Also, if all you are doing is printing static text there's no reason to use PHP, just send it directly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...