Hey everyone,
Newbie PHP guy here, quick Q:
I'm building a content management system for my website.
I've got a page that first authenticates contributors, then asks them for all the details, then passes the results to a script that will write them into MySQL.
Below is the script (just after the authentication has been approved.) Since it has been, I know who's on the page and what their login and password is. How can I get it into the script. The hidden field I'm using doesn't seem to work.
Skip down to "//wait one second ..." to see the part of the script I'm talking about.
Hope you can help!
Thanks.
-john
echo "<hr noshade size=\"5\">";
echo "<h1><center>PREMIER MANAGEMENT SYSTEM</center></H1><p>";
echo "<hr noshade size=\"5\">";
echo "<p>Hi $username.<br>Please choose the section of the Premier site you want to update!<p>";
//here begins the content management part of the code
//PLEASE NOTE: the login if/then continues below this code!!! Don't delete it!
//which section will we update?
echo "<form method=\"post\" action=\"pms.php\">
<select name=\"category\" >
<option value=\"null\">Premier Management System</option>
<option value=\"null\">Public Information Sections of the Site</option>
<option value=\"news\">News</option>
<option value=\"events\">Events</option>
<option value=\"null\">Brochure Sections of the Site</option>
<option value=\"studach_pub\">Student Achievement</option>
<option value=\"schooleff_pub\">School Effectiveness</option>
<option value=\"famcom_pub\">Family&Community</option>
<option value=\"null\">Student Support Sections of the Site</option>
<option value=\"kidscape\">Kidscape</option>
<option value=\"teenzine\">Teenzine</option>
<option value=\"campuslife\">CampusLife</option>
<option value=\"null\">Educator and Family Support Sections of the Site</option>
<option value=\"elem_sup\">Primary/Elementary</option>
<option value=\"mshs_sup\">Middle School and High School</option>
<option value=\"college_sup\">Higher Education Division</option>
<option value=\"family_sup\">Family&Community</option>
</select>";
//get a title
echo "<p><b>Step 1: Title of Your Article</b><br>
Please write the title of your article in the space below.
Titles need to be 250 characters or less in length. Of course, that's the
maximum ... I suggest you make them much shorter than that! 50 to 75 characters
should do.<br>
<input type=\"text\" name=\"title\" size=\"75\" maxlength=\"250\"
<p>";
//get an abstract
echo "<p><b>Step 2: First Paragraph of Your Article</b><br>
Now, give me a brief abstract of your article. Be aware: <i>this
is your first paragraph, your introductory paragraph</i>. It will be published at the
very beginning of your article.
<p>Also, please note that this abstract will be searched when people search the
Premier site for content. So include any keywords that people looking for your
article might use.
<TEXTAREA NAME=\"abstract\" ROWS=8 COLS=60></TEXTAREA>";
//ok, now we can get the article itself
echo "<p><b>Step 3:Full Article, Including First Paragraph</b><br>
OK, finally we get to the article itself!<p>
I'm assuming you've checked, rechecked, spellchecked, and otherwise ensured
that not only is this article accurate and error-free, it's also something
that our clients are interested in, need to know, and that we want our clients
to know. This is easiest to do if you write it in Word or AppleWorks, spellcheck
it, get some feedback from other people on it, and then cut and paste it into
the form below.<p>
However, be aware that simply posting an article here does not place it on our site.
It simply places your article in a queue on our development server which will be
checked daily. Approved articles will be marked, and uploaded around 1:00 A.M. PST.<p>
<b>PLEASE NOTE</b><BR>
Put your entire article, including the first paragraph, or abstract, in the form
below. You submitted it previously so we could search efficiently on our articles, but
we need the whole article, first paragraph included, below. Thanks!<br>
<TEXTAREA NAME=\"body\" ROWS=45 COLS=60></TEXTAREA>";
//wait one second! we'll need the author's name for pms.php to do what we need to
//do in the databse .... so let's add a hidden field to pass along that variable!
echo "<input type=\"hidden\" name=\"name\" value=\"$username\">";