Dw CS & PHP - calling David Powers
David,
Does Dw CS treat php any differently - i.e does all / most of
the
information in your book still apply ?
thanks
Malcolm
~Malcolm N....
~
<DUCK!>
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"David Powers" <[email protected]> wrote in message
news:f0lh51$ro$[email protected]..
> Steve Fleischer wrote:
>> That was a cover - he was really a secret agent,
code name OOP. They
>> based some films on his adventures...
>
> My cover blown at last! I did a degree in Russian, and
my first job was
> with the COI (Central Office of Information - UK
government publicity).
> Most of my friends thought it was a cover for the CIA!
Actually, it was,
> but now that I've told you... ;-)
>
> --
> David Powers, Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of
ED)
> Author, "PHP Solutions" (friends of ED)
>
http://foundationphp.com/
Similar Messages
-
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP by David Powers
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and
PHP by David Powers:
Would this book help me learn about Spry and Ajax and how
applications can be made with them, if I my e-commerce site runs on
a compiled C code shopping cart (ShopSite) but supports PHP
server-side scripts or is it only for shopping carts based on PHP
itself (like X-Cart)?
I am not sure. Someone please let me know so I can purchase
this book. Thanks.ahsenabro wrote:
> 1. Do I have to be a developer/programmer in order to
learn from this book or
> can a tech-savvy entrepreneur can also get some gems out
of it and direct his
> programmer?
You don't need any prior knowledge of Ajax or PHP, but you do
need to
know the basics of HTML and CSS. As I say in the
introduction, "You
don't need to be an expert, but you do need to have an
inquiring mind.
It doesn't teach the basics of web design, nor does it
attempt to list
every single feature in Dreamweaver CS3. There are plenty of
other books
to fill that gap. However, by working through this book,
you'll gain an
in-depth knowledge of the most important features of
Dreamweaver."
> 2. I am interested in purchasing this book mainly to
implement cool Ajax/Spry
> stuff on my e-commerce site. I am asking about PHP
because the book's content
> mentions making a PHP site. Now I realize this book is
not about shopping
> carts, but the Ajax/Spry stuff can be implemented on
e-commerce sites, right?
The book provides detailed coverage of the Spry 1.4 features
in
Dreamweaver CS3, which can be applied to any site. With minor
adaptation, you can also use Spry 1.6. It's important to
realize,
though, that the Spry/Ajax features in Dreamweaver CS3 do
*not* cover
asynchronous requests to the server. The ability to
communicate
asynchronously with the server was added in Spry 1.6. If it's
asynchronous server calls and responses that you're after,
your
programmer will need to dig around in the Spry 1.6
documentation on the
Adobe Labs site, and hand-code it.
The Spry features covered in the book are Spry Effects, Spry
UI widgets
(menu, accordion, tabbed panels, and collapsible panels),
Spry
Validation Widgets, and Spry XML Data Sets.
> I just want to know if I can learn and implement
Ajax/Spry apps on my
> simple HTML/CSS-based pages, on a server which allows
server-side PHP scripts
> but the pages themselves are not with .php extension. Is
this book still going
> to be applicable?
Yes. All the Spry techniques can be used on any web page. It
doesn't
need to be a PHP one.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Same old same old: calling David Powers
It has been interesting to watch and read the comments recently about the DW tangle with database-driven sites.
I am using DW CS6 (12.03) Mac with Mountain Lion, and have MAMP installed and runnning.
I have religiously finished David Powers tute at here.
Question:
Why am I getting the "Dynamically related files could not be resolved because of an internal error" when I render the page with the Live button?
The page displays blank . . . LOL
Can anyone point me to the possible cause?
I wonder why Adobe has left this up for 3 years when (after all updates) the message still appears and development stops.
Are the tutorial files faulty, or have I missed soemthing?
David: can you shed light on this please?Nancy and David
Thanks for reply and here are your suggestions:
Below that 3 screen shots (2 from DW and 1 from phpMyAdmin FYI.
I have rebuilt this several times (incl DW Site, database and DW Connection) but I am still running into the same error msg as originally when "Live" is attempted in DW.
Code from Comment.php
start---------------------------------------------------------
<?php require_once('Connections/connTest.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
mysql_select_db($database_connTest, $connTest);
$query_getComments = "SELECT first_name, last_name, `comment` FROM comments ORDER BY comment_id DESC";
$getComments = mysql_query($query_getComments, $connTest) or die(mysql_error());
$row_getComments = mysql_fetch_assoc($getComments);
$totalRows_getComments = mysql_num_rows($getComments);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cafe Townsend - Customer Comments</title>
<link href="assets/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header"><img src="assets/header.jpg" width="700" height="92" alt="Cafe Townsend" /></div>
<h1 id="main_header">Cafe Townsend Intranet</h1>
<div id="main">
<h2>Customer comments</h2>
<div id="comments">
<?php do { ?>
<p><?php echo $row_getComments['comment']; ?> — <?php echo $row_getComments['first_name']; ?> <?php echo $row_getComments['last_name']; ?></p>
<?php } while ($row_getComments = mysql_fetch_assoc($getComments)); ?>
</div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<?php
mysql_free_result($getComments);
?>
end -------------------------------------------
Looking forward to your thoughts on this. Tony
Thanks again! -
New book for php by David Powers
Good morning,
i see Davids new book is coming out tuesday, a must read for all
http://foundationphp.com/phpsolutions/index.phpGood morning,
i see Davids new book is coming out tuesday, a must read for all
http://foundationphp.com/phpsolutions/index.php -
Need help adapting David Powers PHP email form script please!
Hi all,
I'm fairly inexperienced with PHP and I'm trying to adapt the David Powers email form script from THE ESSENTIAL GUIDE TO DREAMWEAVER CS4 WITH CSS, AJAX, AND PHP.
I've created a basic form so that visitors to the site can request a telephone call back from the site owner. The form asks the visitor for their name, telephone number and to select a time of day suitable for the telephone call to be made using radio buttons selecting between morning and afternoon.
I'd like to achieve my goal with minimal validation error messages and would like to redirect to another page when a message is sent successfully. It is also important that in the spirit of the David Powers script I'm trying to work with, that it filters out suspect input, avoids email header injection attacks and blocks submission by spam bots.
There may be a really simple solution to this since I don't want users to be able to enter an email address at all but I don't know enough to be able to figure it out just yet.
I'd be grateful for any advice.
See below for the code for the form including PHP so far...
Thanks to everyone looking in in advance
Karl.GEAtkins wrote:
> I am using the redirect to a personal page from page 515
of The Essential
> Guide to DWCS3 in the following form:
$_SESSION[MM_Username].php in the "if
> login succeeds" field.
Thank you for reminding me. There's a mistake in the book,
which I
discovered over the Christmas period, so forgot to send to
friends of ED
for the errata page.
Don't use $_SESSION[MM_Username]. Use $loginUsername instead.
It then works.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
"Adobe Dreamweaver PHP Training from David Powers
“Adobe® Dreamweaver® CS5 with PHP Training from the Source David Powers
Lesson 7 Validating Input on the Server
I have reached page 445, and become completely stuck - I've been about three weeks trying to sort the problem but cant get anywhere. Not sure what to do from here so any advice would be really appreciated. The problem:
I have completed the script exactly as instructed, when I go live (local sever), I get a blank screen, OK, does not display. I am sure this is something simple but I have done all the fault finding and am out foxed. I know the local server works OK - I completed chapter 6 successfully - I can also run a php test page from the local folder that the file is stored in. i.e provictis/phpcs5. I have saved my ZendFraework in a separate location as advised. i.e. User/SPENNY/...
This is the basic code:
<?php
$library='/Users/SPENNY/ZendFramework/library';
set_include_path(get_include_path() . PATH_SEPARATOR .
$library);
require_once('Zend/Loader/Autoloader.php');
$loader=Zend_Loader_Autoloader::getInstance();
if ($loader) {
echo 'ok';
} else {
echo 'Huston we have a blinkin problem, but do not panic we will get things sorted';
GarethFIXED!!
1)
i finally did get the message problem was with:
$mailhost='ssl://mail.domain.com';
ssl:// was just nonsense and been removed
2)
'auth' => 'true' was changed to 'auth' => 'login'
3)
for bluehost i got information that it was tls secure connection protocol not ssl
'ssl' => 'tls'
4)
port used '25' not 465.
Didnt still tried 26 and 465 maybe they would work too. -
Using PHP to identify the current page - by David Powers
Hi There,
I'm trying to write a script so I can identify the sub-pages under "Gallery" in my website
Under Gallery I have more than hundred pages describing the photos but I want to identify them as the "Gallery" page.
How do I achieve that?
It would be tedious to write the "PHP if" statement for each photo link.
I trust there is a simpler solution.
In PHP solutions by David Powers, Ch.4 "Using PHP to identify the current page"
The script is:
<?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?>
<ul id="nav">
<li><a href="index.php" <?php if ($currentPage == 'index02.php') {echo 'id="here"';} ?>>Home</a></li>
<li><a href="journal.php" <?php if ($currentPage == 'journal.php') {echo 'id="here"';} ?>>Journal</a></li>
<li><a href="gallery.php" <?php if ($currentPage == 'gallery.php') {echo 'id="here"';} ?>>Gallery</a></li>
<li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li>
</ul>
Let's say that the gallery pages contains hundreds of links gallery like gallery/photos1.php, gallery/photos2.php, gallery/photos3.php, gallery/photos4.php, gallery/photos5.php, gallery/photos6.php, gallery/photos7.php etc...
How would I identify the sub-pages so when we are there Gallery is highlighted?
Thank you!
Best,Hello Siddhardha,
To get the details of a process you need to use Locator class from BPEL api. You can locate your process by listInstances method which accepts WhereCondition parameter used to build a query on process instances. Once you've found the process you were looking for you can use getAuditTrail method to retrieve audit trail of a given instance. You can also use setStatus() method from a BPELX java exec tag within your process and later retrieve it from instance handle by getStatus method.
A sample snippet to retrieve instance handles to all child processes of a given process:
StringBuffer sb = new StringBuffer();
Locator locator = new Locator(domain,domainpassword);
WhereCondition wc = new WhereCondition();
String query = sb.append(SQLDefs.AL_ci_root_id).append(" = ? ").toString();
wc.append(query);
wc.setLong(1,parentInstance);
IInstanceHandle[] ih = locator.listInstances(wc);
You can read more about querying processes on http://blogs.oracle.com/matt/2006/06/27?print-friendly=true
Radoslaw -
I have adapted a php contact form of David Powers tut
Hi I have slowly changed according to my research etc. I am
worried that since changing things that I have left some important
error checking.
Well here is the error checking and the form:
<h2><span class="black">contact us :
</span></h2>
<span class="errmsg1">
<?php
if ($error) {
echo 'Please complete the missing item(s) indicated.';
// remove escape characters from POST array
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep',
$value) : stripslashes($value);
return $value;
$_POST = array_map('stripslashes_deep', $_POST);
?>
</span>
<form name="option" id="option" method="post"
action="<?php $_SERVER['PHP_SELF']; ?>">
<label> </label>
<table width="70%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td>Your Name</td>
<td><input name="name" type="text" class="search"
id="name" value="<?php if (isset($_POST['name'])) {
echo htmlentities($_POST['name']);} ?>" size="30"
maxlength="50" /></td>
</tr>
<tr>
<td> </td>
<td><?php if (isset($error['name'])) { ?>
<span class="errmsg1"><?php echo $error['name'];
?></span>
<?php } ?> </td>
</tr>
<tr>
<td><span class="subheader">Your Email
Address</span></td>
<td><span class="subheader">
<input name="email" type="text" id="email"
value="<?php if (isset($_POST['email'])) {
echo htmlentities($_POST['email']);} ?>" size="30"
maxlength="80" />
</span></td>
</tr>
<tr>
<td> </td>
<td><?php if (isset($error['email'])) { ?>
<span class="errmsg1"><?php echo $error['email'];
?></span>
<?php } ?> </td>
</tr>
<tr>
<td>Reason For Enquiry </td>
<td><label>
<select name="option">
<option value="">Please Select Option</option>
<option value="complaint"<?php
if (isset($error) && $_POST['option'] ==
'complaint') { ?>
selected="selected"
<?php } ?>>Complaints</option>
<option value="listbusiness"<?php
if (isset($error) && $_POST['option'] ==
'listbusiness') { ?>
selected="selected"
<?php } ?>>List My Business </option>
<option value="removelisting"<?php
if (isset($error) && $_POST['option'] ==
'removelisting') { ?>
selected="selected"
<?php } ?>>Remove My Listing</option>
<option value="upgradelisting"<?php
if (isset($error) && $_POST['option'] ==
'upgradelisting') { ?>
selected="selected"
<?php } ?>>Upgrade Listing</option>
<option value="banner"<?php
if (isset($error) && $_POST['option'] == 'banner') {
?>
selected="selected"
<?php } ?>>Banner Advertising</option>
<option value="agentenquiry"<?php
if (isset($error) && $_POST['option'] ==
'agentenquiry') { ?>
selected="selected"
<?php } ?>>Become An Agent</option>
<option value="other"<?php
if (isset($error) && $_POST['option'] == 'other') {
?>
selected="selected"
<?php } ?>>Other</option>
</select>
</label></td>
</tr>
<tr>
<td> </td>
<td><?php if (isset($error['option'])) { ?>
<span class="errmsg1"><?php echo $error['option'];
?></span>
<?php } ?> </td>
</tr>
<tr>
<td>Message</td>
<td><label>
<textarea name="message" cols="30" rows="3"
id="message"><?php if(isset($error)) {echo $messageBody;}
?>
</textarea>
</label></td>
</tr>
<tr>
<td> </td>
<td><?php if (isset($error['message'])) { ?>
<span class="errmsg1"><?php echo $error['message'];
?></span>
<?php } ?> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input name="send" type="submit" class="searchbutton"
id="send" value="Enquiry" />
</label></td>
</tr>
</table>
<label> </label>
<p><span class="subheader">
<label> </label>
</span></p>
</form>jjjhbj111 wrote:
> Hi I have slowly changed according to my research etc. I
am worried that since
> changing things that I have left some important error
checking.
I haven't gone through your script with a fine-tooth comb,
but your
email check uses a POSIX regular expression, which won't work
with
preg_match(). You could use eregi() instead, but there are
plans to
remove the ereg_ functions from PHP 6, so you would be better
advised to
stick with Perl-compatible regular expressions (PCRE).
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
David Powers cs5 with php...Zend
This one is aimed for David Powers. We are using your book for my advanved programming class. I continually have problems because they had us buy a domain instead of the one the book does it. At this point I'm on page 222ish, installing Zend. Obviously I'm using dreamweaver and my domain is with godaddy.com. I'm doing the section where you are are installing the library. I've got the library.php with no errors, I'm connected to my domain, and I have the zend file inside my local site folder. I've tried in the C drive but I cotinually get the same error:
Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in/home/content/79/7340479/html/library.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.:/usr/local/php5/lib/php:C:\Users\Becky\Desktop\colts\ZF\ZendFramework-1. 11.4-minimal\library') in /home/content/79/7340479/html/library.php on line 4
I've tried putting the zend folder in c, desktop, in side local site folder and same thing everytime. Any help would be appreciated.Re: David Powers cs5 with php...Zend
Ok I'm gonna try and help ya until David gets here. Since I use Zend and have read parts of his book.
First, are you trying to install zend at godaddy?
Your include file is odd. "include_path='.:/usr/local/php5/lib/php:C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library') in/home/content/79/7340479/html/library.php" - means PHP and Zend are located on 2 different machines
I appreciate it. the "C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library' is where the file path.I use Godaddy but I have it zend on my computer and am just trying to get it to run. I tried running it from desktop, C:(where it's at), andneven put it in the file manager on godaddy and tried that path...
the code I'm using is:
<?php
$library = 'C:\Users\Becky\Desktop\colts\ZF\ZendFramework-1.11.4-minimal\library';
set_include_path(get_include_path() . PATH_SEPARATOR . $library);
require_once('Zend/Loader/Autoloader.php');
$loader = Zend_Loader_Autoloader::getInstance();
if ($loader) {
echo 'OK';
} else {
echo 'We have a problem';
I'm followed the book step by step but...
when i click autoloader.php in the tab bar it has a get option. but when i click it it says "operation failed because it is not on the remote site. -
Creating category lists with php (David Powers???)
I am creating a dynamic content website with numerous entries under various categories. The categories are kept in a seperate mysql that looks something like this (an example):
ID
Main
Sub
1
food
candy
2
food
meat
3
drink
coke
4
drink
snapple
5
drink
dr. pepper
6
food
bread
I have created a page where the user can see all of the main categories. In the above case, food and drink. I do not want 'food' and 'drink' to be repeated three times. So I have used php code which david powers gives in his recipe: http://cookbooks.adobe.com/post_Create_nested_lists_from_a_recordset__PHP_-16720.html.
The problem is that in the above case, the page will list: food, drink, food. This is because when the php passes through the 'drink's it then sees the last 'food' as being unique.
How do I get rid of this issue (without having to to continuosly reorder my mysql table)?
thanks
P.S. I am posting this here and not on the above recipe page because I am hoping for a quicker response.Re: David Powers cs5 with php...Zend
Ok I'm gonna try and help ya until David gets here. Since I use Zend and have read parts of his book.
First, are you trying to install zend at godaddy?
Your include file is odd. "include_path='.:/usr/local/php5/lib/php:C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library') in/home/content/79/7340479/html/library.php" - means PHP and Zend are located on 2 different machines
I appreciate it. the "C:\Users\Becky\Desktop\colts \ZF\ZendFramework-1.11.4-minimal\library' is where the file path.I use Godaddy but I have it zend on my computer and am just trying to get it to run. I tried running it from desktop, C:(where it's at), andneven put it in the file manager on godaddy and tried that path...
the code I'm using is:
<?php
$library = 'C:\Users\Becky\Desktop\colts\ZF\ZendFramework-1.11.4-minimal\library';
set_include_path(get_include_path() . PATH_SEPARATOR . $library);
require_once('Zend/Loader/Autoloader.php');
$loader = Zend_Loader_Autoloader::getInstance();
if ($loader) {
echo 'OK';
} else {
echo 'We have a problem';
I'm followed the book step by step but...
when i click autoloader.php in the tab bar it has a get option. but when i click it it says "operation failed because it is not on the remote site. -
David Powers, please help...
Hi David,
I have posted a similar message on the general DW forum but I
think this
might be the more appropriate place; besides which I'm not
getting much
traction there.
I'm creating a detail page to display records which contain
anywhere
from 1-12 images per record. I'm trying to make a small image
gallery
similar to what you have in your PHP DW8 book pg. 414, though
it will
only show the images for the current record. The problem is
all the
images are different sizes and orientations, so I need a way
to pass the
image width to the javascript function so it will display the
image in a
size that fits my container. I have been scratching my head
on this one
for a while and I'm hoping you can point me in the right
direction.
Here is what I have so far:
My scaling routine:
> $image2 = $maindir . $row_gallery_show['image2'];
> $image2Size = getimagesize($image2);
> if ($image2Size[0] > $image2Size[1]) {
> $ratio_1 = $maxsize/$image2Size[0]; $newWidth =
> round(($image2Size[0]*$ratio_1),0);}
> else {
> $ratio_1 = $maxsize/$image2Size[1]; $newWidth =
> round(($image2Size[0]*$ratio_1),0);}
>
>
> $image3 = $maindir . $row_gallery_show['image3'];
> $image3Size = getimagesize($image3);
> if ($image3Size[0] > $image3Size[1]) {
> $ratio_1 = $maxsize/$image3Size[0]; $newWidth =
> round(($image3Size[0]*$ratio_1),0);}
> else {
> $ratio_1 = $maxsize/$image3Size[1]; $newWidth =
> round(($image3Size[0]*$ratio_1),0);}
I have this for each of the images.
My markup:
> <li class="thumbs"><a href="<?php echo
$image2;
> ?>"onclick="showImage(this);return false;">
> <img src="<?php $pic2 = $thumbdir .
> $row_gallery_show['image2'];?>
> <?php $pos2 = strrpos($pic2, '.');
> $thumb2 = substr($pic2, 0, $pos2) . '_thb' .
> substr($pic2, $pos2);
> echo $thumb2; ?> " /></a>
> </li>
> <li class="thumbs"><a href="<?php echo
$image3;
> ?>"onclick="showImage(this);return false;">
> <img src="<?php $pic3 = $thumbdir .
> $row_gallery_show['image3'];?>
> <?php $pos3 = strrpos($pic3, '.');
> $thumb3 = substr($pic3, 0, $pos3) . '_thb' .
> substr($pic3, $pos3);
> echo $thumb3; ?> " /></a>
> </li>
also for each image.
And the javascript file:
> // JavaScript Document
> function showImage(elem) {
> if(!document.getElementById) {
> return false;
> } else {
> var bigPic = elem.getAttribute('href');
>
>
document.getElementById('mainpic').firstChild.setAttribute('src',bigPic);
> <?php echo "var newWidth = $newWidth"; ?>
>
>
document.getElementById('mainpic').firstChild.setAttribute('width',
> newWidth);
>
> }
> }
I have tried setting the width through $newWidth, but so far
it's not
working - instead of replacing the 'mainpic' it is opening
the selected
image in a new window, full size. What am I doing wrong here?
How can
I get this to work, or is there a better approach?
TIA
BrettBrett wrote:
> I have tried setting the width through $newWidth, but so
far it's not
> working
Of course it won't. PHP is a server-side language; the
JavaScript
function is client-side. You can't get PHP to change the
value of the
width, because the PHP script finishes working as soon as the
page is
sent to the browser.
I haven't checked through your width calculations, but what
you need to
do is to use PHP to echo the value of the width for each
image in the
call to showImage():
<a href="<?php echo $image2; ?>"
onclick="showImage(this, <?php echo
$newWidth; ?>);return false;">
Then change the showImage() function to apply the new width:
function showImage(elem, w) {
if(!document.getElementById) {
return false;
} else {
var bigPic = elem.getAttribute('href');
document.getElementById('mainpic').firstChild.setAttribute('src',bigPic);
document.getElementById('mainpic').firstChild.setAttribute('width',
w);
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/ -
Stuck in Tutorial 2 of David Powers tutorials "Build dynamic sites and web applications".
PLEASE NOTE - THIS IS ANEW SESSION! Apologies to those that have contributed already but I have been unable to reply unless by email on the original session!
========================================================================================== ==============================
I am very new to Dreamweaver and indeed to mySql. So, I am going through the the 3 David Powers Tutorials that are available for PHP & MySQL. I have successfully negotiated the 1st tutorial and am on the 2nd one and have got to a place where I am stalled!I am working on the file "manage_posts.php" and have got successfully "Building a simple recordset" - successfully built the Recordset via that dialog box which tests perfectly showing the contents of the news Table in MySQL. I can bind the recordset results in the page and save the file "manage_posts.php" but when I click Live View the live view fails and I get a 404 error - in other words manage_posts.php does not show the last entry of the news table! I have tried everything that I can think of including deleting manage_posts.php and starting over, but still no good!
Can anyone advise me on this please as to waht may be wrong and how perhaps to analyse what the error may be? I would appreciate any help as it is very frustrating not to be able to progress further.PLEASE NOTE - THIS IS ANEW SESSION! Apologies to those that have contributed already but I have been unable to reply unless by email on the original session!
========================================================================================== ==============================
I am very new to Dreamweaver and indeed to mySql. So, I am going through the the 3 David Powers Tutorials that are available for PHP & MySQL. I have successfully negotiated the 1st tutorial and am on the 2nd one and have got to a place where I am stalled!I am working on the file "manage_posts.php" and have got successfully "Building a simple recordset" - successfully built the Recordset via that dialog box which tests perfectly showing the contents of the news Table in MySQL. I can bind the recordset results in the page and save the file "manage_posts.php" but when I click Live View the live view fails and I get a 404 error - in other words manage_posts.php does not show the last entry of the news table! I have tried everything that I can think of including deleting manage_posts.php and starting over, but still no good!
Can anyone advise me on this please as to waht may be wrong and how perhaps to analyse what the error may be? I would appreciate any help as it is very frustrating not to be able to progress further. -
I've tried to figure this out with the posts (and some info
on David's site, etc), and I just can't seem to figure out the real
problem.
I'm working on a tutorial and I can't figure out if the error
message is correct and it's improper coding inserted by DW (and if
so, I can't figure out what to correct) or
If this is a problem with DW8.0.2 along the lines of what the
hotfix that seems to be so hard to get will fix, or
If this is along the lines of an example of why magic quotes
should be turned off, and if so, where/how do I turn them off, and
will that correct the code, and if not, how would it be properly
corrected?
Here is the error message:
Parse Error: parse error, unexpected '=', expecting ',' or
')' in <thefile> on line 34.
Here is the code it is referencing:
32 $Search_rsSearch = "abc";
33 if (isset(#txtSearch#)) {
34 $Search_rsSearch = (get_magic_quotes_gpc()) ? #txtSearch#
: addslashes(#txtSearch#);
35 }
36 mysql_select_db($database_dorknozzle, $dorknozzle);
37 $query_rsSearch = sprintf("SELECT * FROM EmployeeStore
WHERE ItemName LIKE CONCAT('%%', %s,
'%%')", GetSQLValueString($Search_rsSearch, "text"));
38 $rsSearch = mysql_query($query_rsSearch, $dorknozzle) or
die(mysql_error());
39 $row_rsSearch = mysql_fetch_assoc($rsSearch);
40 $totalRows_rsSearch = mysql_num_rows($rsSearch);
I'm using php4.4.4, mysql5.0.24, apache2.2.3
Thank You,
Jeff G.xViPERed wrote:
> If this is a problem with DW8.0.2 along the lines of
what the hotfix that
> seems to be so hard to get will fix,
That will fix part of your problem, but the error is caused
by something
else:
> Here is the error message:
>
Parse Error: parse error, unexpected '=', expecting ',' or
')' in
> <thefile> on line 34.
>
> Here is the code it is referencing:
> 32 $Search_rsSearch = "abc";
> 33 if (isset(#txtSearch#)) {
> 34 $Search_rsSearch = (get_magic_quotes_gpc()) ?
#txtSearch# :
> addslashes(#txtSearch#);
> 35 }
# is one of the PHP characters used to comment out part of a
script. I
suspect that you have got this from the Dreamweaver help
files, which
are particularly unhelpful on this point. The show the
runtime value
expression as #formFieldName#, which is ColdFusion style, not
PHP. You
need to replace #txtSearch# with something like
$_GET['search'] or
$_POST['search'].
What makes things worse is that the code inserted by 8.0.2
without the
hotfix is also incorrect. Line 34 should be something like
this:
$Search_rsSearch = $_GET['search'];
Line 37 is also wrong.
> 37 $query_rsSearch = sprintf("SELECT * FROM
EmployeeStore WHERE ItemName LIKE
> CONCAT('%%', %s,
> '%%')", GetSQLValueString($Search_rsSearch, "text"));
It should be this:
$query_rsSearch = sprintf("SELECT * FROM EmployeeStore WHERE
ItemName
LIKE %s", GetSQLValueString("%" . $Search_rsSearch . "%",
"text"));
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/ -
David,
Hope you having a good break from here - as you've not been
around for
a few days.
When you are back - I need a little help please
~Malcolm N....
~> Come to think about it - Murray seemed to make the move
to using php
> only a few months ago - and given his enthusiasm for
SSI's maybe this
> tells something about the next release - or maybe I'm
reading too much
> between the lines (:-))
You're looking for deep inner meaning in a shallow bowl, I'm
afraid! 8)
Templates are part of DW and will be for a long time. And
personally, I
have no problem with includes in DW templates.....
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Malcolm N_" <[email protected]> wrote in message
news:[email protected]...
> On Sat, 27 Jan 2007 19:38:04 +0000, David Powers
<[email protected]>
> wrote:
>>
>>I'll wait for the summary. The basic thing to
remember about include()
>>is that it expects a relative path, an absolute path,
or for the file to
>>be in the PHP include path.
>
> Thanks David - at the moment things are under control,
but I haven't
> altered much of the site with DW.
>
>> Things get complicated if you use includes
>>with Dreamweaver templates.
>
> Yes - well DW has been good at controlling some tricky
things to date,
> I hope that the next release makes using includes within
simple
> Template's a little easier.
>
> After all the Adobe Community Experts have been pushing
the use of
> SSI's very strongly in the last couple of years, telling
us to abandon
> tables, and complex templates (:-))
>
> Come to think about it - Murray seemed to make the move
to using php
> only a few months ago - and given his enthusiasm for
SSI's maybe this
> tells something about the next release - or maybe I'm
reading too much
> between the lines (:-))
>
> --
>
> ~Malcolm N....
> ~ -
Question for David Powers re file 'quotations.sql'
It would appear from the first few lines of this file (shown
below) that it
first checks if a table "quotations" already exists, and if
so deletes it. Then
it creates a new version, and populates it with the following
data.
Is this correct?
Clancy
-- Table structure for table `quotations`
DROP TABLE IF EXISTS `quotations`;
CREATE TABLE `quotations` (
`quote_id` int(10) unsigned NOT NULL auto_increment,
`quotation` varchar(255) NOT NULL default '',
`first_name` varchar(30) NOT NULL default '',
`family_name` varchar(30) NOT NULL default '',
PRIMARY KEY (`quote_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- Dumping data for table `quotations`
INSERT INTO `quotations` VALUES (1, 'My disability is ......'
ClancyClancy wrote:
> I thought so. As the sql file redefines the table, is it
necessary to define
> the table at all before running the file?
The purpose of the preceding section is to teach you how to
define a
table. If all you're interested in is copying my table
structure, feel
free to do so. However, I believe in the principle of
teaching a man to
fish, rather than giving a man a fish.
> I have been thinking about how to set up a database for
my photo album, and
> wondering how to order it. If I have a text file, like
'quotations.sql', it
> looks as if the easiest way to change the order of the
photos is to swap the
> lines in the text file, and then reload the whole
database.
If that's your conclusion, then I'm afraid that you have
failed to
understand the fundamental principles of how a database
works. The order
in which records are entered is totally irrelevant. You use
SQL to
display them in whichever order you require.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Maybe you are looking for
-
Can I watch a rental movie from my iPad through Airplay on my second generation Apple TV?
I am trying to watch a movie rental from my ipad through Airplay on my TV. Doesn't seem to be working. Is this possible?
-
Are you having problems joining previously used Wi-Fi networks that require you to view a login or redirect page (say to accept Terms of Use) first? The problem could be your Auto-Login Wi-Fi network setting. I found numerous cases where I could not
-
Dear forum, We can directly insert to table in bulk like insert into target as select * from source1 a,source_2 b where a.s1=b.s2 From the perfomance itself we know that above is n't a record by record insert instead it is bulk insert . 1) Experts pl
-
Record Mode in SRM Std Extractor.
Hi All, In the SRM std extractor for POs we are having an issue. The POs which are deleted in SRM are supposed to be deleted in BW DSO as well. But this doesn't always happens for POs with limit Line items. Rest all the records are deleted and one Li
-
Shutting down secondary DAG node
Two Exchange servers setup in a DAG. I need to expand the log VM on our secondary Exchange server (2013). I am very new to DAG Exchange administration. I am aware there are scripts to initiate DAG maintenance. I am just curious if this can be safely