Jump to content

need help modifying program


bubblybabs

Recommended Posts

I'm modifying the gcards program for my own use and have been sharing the mods I've figured out with the other users as I go along...  I am still in the learning stages so I'm having to fix boo-boo's as I go along and yes, I've even gone out and bought books on php and MySQL as well as dug about on the internet for information as well as looked at the coding til my eyes are crossed before coming here...

My problem:  I've made it so that I can add new fields into the MySQL table from the admin panel but I can't figure out how to make it so that I can edit the info if I need to...  I have somehow made it so that one of the fields I added is editable but the other three are not and I can't figure out what I did right in the one instance and am doing wrong in the others...

So, I'm looking for help...

Here is the coding I'm working on for editCard.php (I have added the coding for copyright, physicalsize, filesize, and animated) (there are 2 other files that interact with this one, cards.php and upload.php, if needed I can post those two modified files here as well):


<?
/*
* gCards - a web-based eCard application
* Copyright (C) 2003 Greg Neustaetter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
session_start();
include_once('loginfunction.php');
include_once('../inc/UIfunctions.php');
include_once('../config.php');

if (isset($_GET['imageid'])) $imageid = $_GET['imageid'];
$page = new pagebuilder('../', 'admin.php');
include_once('../inc/setLang.php');
checkUser();

$page->showHeader($nav05);

include_once('../inc/adodb/adodb.inc.php');   # load code common to ADOdb

$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$conn = &ADONewConnection('mysql'); # create a connection
$conn->Connect($dbhost,$dbuser,$dbpass,$dbdatabase);
$sqlstmt = 'select category, catid from '.$tablePrefix.'categories';
$recordSet = &$conn->Execute("$sqlstmt" );
$cardsql = "SELECT ".$tablePrefix."cardinfo.imageid,
".$tablePrefix."cardinfo.cardname,
".$tablePrefix."cardinfo.copyright,
".$tablePrefix."cardinfo.physicalsize,
".$tablePrefix."cardinfo.filesize,
".$tablePrefix."cardinfo.animated,
".$tablePrefix."categories.category,
".$tablePrefix."cardinfo.imagepath,
".$tablePrefix."cardinfo.thumbpath from ".$tablePrefix."cardinfo, ".$tablePrefix."categories WHERE ".$tablePrefix."cardinfo.catid=".$tablePrefix."categories.catid AND ".$tablePrefix."cardinfo.imageid=$imageid";
$cardRecordSet = &$conn->Execute("$cardsql" );
while (!$cardRecordSet->EOF)
{
$cardname = $cardRecordSet->fields['cardname'];
$copyright = $cardRecordSet->fields['copyright'];
$physicalsize = $cardRecordSet->fields['physicalsize'];
$filesize = $cardRecordSet->fields['filesize'];
$animated = $cardRecordSet->fields['animated'];
$category = $cardRecordSet->fields['category'];
$imagepath = $cardRecordSet->fields['imagepath'];
$thumbpath = $cardRecordSet->fields['thumbpath'];
$cardRecordSet->MoveNext();
}
?>
<br><br>
<table>
<tr>
<td width="30">&nbsp;</td>
<td>
<table>
<tr>
<td colspan="2" class="bold"><? echo "$action03 $cards04";?></th>
</tr>
<tr>
<td colspan="2"><img src="../images/<? echo rawurlencode($thumbpath);?>" border="0" alt="Image Thumbnail"></td>
</tr>
<form action="cards.php" method="post">
<input type="hidden" name="action" value="edit">
<tr>
<td><? echo $admin08;?>:</td><td><? echo $imageid;?></td>
<input type="hidden" name="imageid" value="<? echo $imageid;?>">
</tr>
<tr>
<td><? echo $cards05;?>:</td>
<td><input type="text" name="cardname" value="<? echo $cardname;?>"></td>
</tr>
<tr>
<td><? echo $cards05a;?>:</td>
<td><input type="text" name="copyright" value="<? echo $copyright;?>"></td>
</tr>
<tr>
<td><? echo $cards05b;?>:</td>
<td><input type="text" name="physicalsize" value="<? echo $physicalsize;?>"></td>
</tr>
<tr>
<td><? echo $cards05c;?>:</td>
<td><input type="text" name="filesize" value="<? echo $filesize;?>"></td>
</tr>
<tr>
<td><? echo $cards05d;?>:</td>
<td><input type="text" name="animated" value="<? echo $animated;?>"></td>
</tr>
<tr>
<td><? echo $cat01;?>:</td>
<td><? print $recordSet->GetMenu('catid', $category); ?></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="<? echo $action06;?>"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<?
$page->showFooter();
?>



Can anyone see what I'm doing wrong?
Many thanks,
Babs
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.