Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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';
?>
 
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).





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.