I have just added to my site a tutorial on converting a Spry Menu Bar into a server-side include. I have also been busy adding a bunch of brief articles to the Dreamweaver Cookbook on the Adobe site.
I answer a lot of questions in the Dreamweaver forums, and realized that a lot of the solutions I was coming up with for people weren’t easy to find after a couple of days. So, rather than letting them disappear into cyberoblivion, I decided to add any of general interest to the cookbook when I had a few spare moments. The Dreamweaver Cookbook is intended for code samples, and doesn’t have the capability of including screenshots, so I’ll continue posting longer tutorials on my own site. But I hope you’ll find my contributions to the cookbook useful.
Here are direct links to some of the articles I have added to the Dreamweaver Cookbook:
- Create nested lists from a recordset
- Set a time limit on a login session
- Registration system that requires the user to validate the email address (in two parts)
- Alternate colours for table rows (using PHP, Spry, or jQuery)
- Upload image to website
- Format date for insertion into MySQL
- Formatting dates stored in MySQL
The Dreamweaver Cookbook is open to anyone to either request recipes or contribute recipes of their own. It could turn into a very useful resource if people start using it regularly. Check it out!






I used your tutorial for changing the default tab for a Spry tabbed panel. Yes, it works, but the tabbed panel no longer works like a tabbed panel – it’s a single long page, and the tabs are not functional anymore. I followed your instructions, from downloading Spry 1.6. Is this the behavior you intended?
No, it’s not what I intended. If the tabs are no longer functional, it sounds as though you have made a mistake somewhere. Without seeing the page you have built, it’s impossible to say. Of course, it’s possible there’s a mistake in my tutorial, but you don’t say exactly which tutorial you were using. So you don’t give me much to go on to help you.
Dear David,
I’ve been following your tutorial on linking to another page and setting the default Accordion panel. I’m not able to get this to work. First of all, the javascript code for the accordion panel
var Accordion1 = new Spry.Widget.Accordion(“Accordion1″, {defaultPanel: params.panel ? params.panel: 0, useFixedPanelHeights: false});
always leave all my panels in the open state. Furthermore, I’m not able to get the panels param to pass through? I’m not sure since all the panel are already open. Here is the link I’m using:
<a id="content1" href="?recordID=&?panel=1#Accordion1″>
I would appreciate some input thanks.
Rose
Rose, It’s impossible to judge without seeing the actual pages, but if all the panels are open, it sounds as though there’s something wrong with the code on the page that contains the accordion. You need to get that sorted first.
Secondly, your link doesn’t make sense. It has got two question marks and a variable with no value. The href attribute should look something like this:
"somepage.html?panel=1#Accordion1".Dear David,
Here is the code for the second panel that I’m experimenting with.
Doctor Who
<a id="content1" href="?recordID=&?panel=1#Accordion1″>
And here is the javascript code for the panel animation
I hope the above information is more helpful.
What I am doing is passing a php query via an URL to the detail section on the same page. This does work. I’m just trying to get the accordion panel that the user us currently in to stay open. My understanding is any php request cause a page refresh and that is why the panel always defaults to panel=0.
Thanks a bunch
Rose
Update,
I finally got it all to work!
Apparently I didn’t have the code right in the header for the JavaUtils. Once I got that fixed then my panels opened and closed just fine.
Next, I added the tab=n in front of the panel=n#Accordion1 in the URL.
Just to let you know, your tutorial is a bit confusing at that point. I thought you were talking about tabbed panels AND accordion panels. Once I put that in, everything works great.
David,
I followed your instruction for customizing the horizontal menu bar. Fantastic! Clear and easy to follow. Thank you.
Kat
Wow, it’s a lot easier than I thought it would be. Thanks
I am designing a web page and I need a condolences form, much like a blog, where the condolences are published on the website. Any suggestions on putting this form on a dreamweaver page.
You could use the Building Your First Dynamic Website tutorial in the Adobe Developer Connection as a starting point. However, the big problem with online forms that display user input is spam. That tutorial doesn’t teach how to prevent spam. You could use a CAPTCHA, or get the form to send you an email before you approve comments. That’s why blogs are so useful, because they handle all that side of things for you.
The “Upload image to website” recipe in Adobe’s cookbook is great. It works like a charm compared to other tutorials with the same topic.
If, by chance, you’ll find time to write a recipe about how to insert the image’s name and path into a database you’ll make some users happy.
Leolux
Glad you found it useful. I’m up to my eyeballs writing a new book, so I won’t have time to add anything else to the Dreamweaver Cookbook for some time. Sorry.
David,
Sorry to take time from your new book. I suspect it must be the one I pre-ordered at Amazon on Dreamweaver CS5. I never look forward to the end of summer, but this year I am looking forward to August 20th.
I’m building a page based on the “Upload image to website” recipe. Everything works great unless I try to add a duplicate image. Instead of getting the expected “A file of the same name already exists”, the page throws the error: “Undefined variable: success in C:\vhost\filepath\upload.php on line 29″.
Line 29 is the first line of the following section:
if ($success) {
$result = "$file uploaded successfully.";
} else {
$result = "Error uploading $file. Please try again.";
}
Success is first mentioned on line 23 and the entire section is:
$success =
move_uploaded_file($_FILES['image']['tmp_name'], UPLOAD_DIR .
$file);
} else {
$result = 'A file of the same name already exists.';
}
if ($success) {
$result = "$file uploaded successfully.";
} else {
$result = "Error uploading $file. Please try again.";
}
So far I’ve just copy and pasted the code onto a standard blank Dreamweaver PHP page and made the changes needed for my upload directory and filesize. I haven’t added any other HTML or CSS yet. Is there something else I need to change or is there a bug in the code?
Thanks,
Chris