Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 8th, 2009, 01:18 PM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CMS app code compose.php

The compose.php in chapter 13 from PHP6 MYSQL Web Development submit a form with abutton with a label Submit Query, instead of Submit New Article. I cannot find Submit Query anywhere in this code orany called functions or references.
Can Submit Qyery come from a cookie? here is the code.

<?php
require 'db.inc.php';
include 'cms_header.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
die ('Unable to connect. Check your connection parameters.');
mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
$action = (isset($_GET['action'])) ? $_GET['action'] : '';
$article_id = (isset($_GET['article_id']) && ctype_digit($_GET['article_id'])) ?
$_GET['article_id'] : '' ;
$title = (isset($_POST['title'])) ? $_POST['title'] : '' ;
$article_text = (isset($_POST['article_text'])) ? $_POST['article_text'] : '' ;
$user_id = (isset($_POST['user_id'])) ? $_POST['user_id'] : '' ;
if ($action == 'edit' && !empty($article_id)) {
$sql = 'SELECT
title, article_text, user_id
FROM
cms_articles
WHERE
article_id = ' . $article_id;
$result = mysql_query($sql, $db) or die(mysql_error($db));
$row = mysql_fetch_array($result);
extract($row);
mysql_free_result($result);
}
?>
<h2>Compose Article</h2>
<form method="post" action="cms_transact_article.php">
<table>
<tr>
<td><label for="title">Title:</label></td>
<td><input type="text" name="title" id="title" maxlength="255"
value="<?php echo htmlspecialchars($title); ?>"/></td>
</tr><tr>
<td><label for="article_text">Text:</label></td>
<td><textarea name="article_text" name="article_text" rows="10"
cols="60"><?php echo htmlspecialchars($article_text); ?></textarea></td>
</tr><tr>
<td> </td>
<td>
<?php
if ($_SESSION['access_level'] < 2) {
echo '<input type="hidden" name="user_id" value="' . $user_id . '"/>';
}
if (empty ($article_id)) {
echo '<input type="submit"class="submit" name="action" "value="Submit New Article"/>';
} else {
echo '<input type="hidden" name="article_id" value="' . $article_id . '"/>';
echo '<input type="submit" class="submit" name="action" "value="Save Changes"/>';
}
?>
</td>
</tr>
</table>
</form>
<?php
require_once 'cms_footer.inc.php';
?>
Reply With Quote
  #2 (permalink)  
Old November 27th, 2009, 11:52 PM
Registered User
 
Join Date: Nov 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default submit new article

'Submit New Article' shows up as a Case in cms_transact_article.php. I don't know if you have found the solution to this problem yet, but I still can't get this CMS to run properly (won't even submit new article to database).
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF YOU WANT A CMS PHP cyber_kaley20 Beginning PHP 3 August 1st, 2012 05:15 AM
C# Wrox CMS Code jminatel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 June 3rd, 2009 04:41 AM
How can I deploy multiple copies of the CMS app. on the same web server pbourget BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 February 16th, 2009 03:42 PM
How Gmail compose Alert webmahesh ASP.NET 1.0 and 1.1 Basics 0 December 12th, 2007 04:43 AM
Chapter 5 CMS code update posted jminatel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 August 24th, 2007 02:27 AM



All times are GMT -4. The time now is 05:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.