HighDots Forums  

Can visitors interact with PHP echo functions?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Can visitors interact with PHP echo functions? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David B
 
Posts: n/a

Default Can visitors interact with PHP echo functions? - 05-20-2004 , 04:25 PM






I have four pages that use the same form, which is linked to the same
JavaScript file. Each page is also linked to a second JavaScript file,
which dictates whether the form will convert units of length, area,
weight or volume.

I don't know enough about JavaScript to even attempt to combine all four
JavaScript files, but there must be a way to create a single page that
performs all four functions.

To get the ball rolling, I changed the link to the second JavaScript
file to this:

<script language="JavaScript" src="<?php echo $seg ?>a1/js/cv<?php echo
$unit ?>.js"></script>

If I want the form to spit out lengths, then I change the head section
in the target page to this:

<?php
$seg = '../../../';
$unit = 'length';
?>

If I want to focus on weight, I change it to this:

<?php
$seg = '../../../';
$unit = 'weight';
?>

The next step is to create some sort of function that visitors can use
to toggle between style sheets. Basically, they would change $unit =
'weight'; to $unit = 'length';, $unit = 'area';, etc.

Can that be done?

I already have a style sheet select function that looks like this:

<a href="#" onclick="setActiveStyleSheet('Spring'); return false;"
title="Spring">Spring</a>

But I can't figure out how to adapt it to an echo function - $unit = 'area';

Does anyone have a solution? Either a PHP or JavaScript solution would
be fine - whatever works!

Reply With Quote
  #2  
Old   
craig v
 
Posts: n/a

Default Re: Can visitors interact with PHP echo functions? - 05-20-2004 , 04:57 PM






http://www.alistapart.com/articles/phpswitch/



Reply With Quote
  #3  
Old   
David B
 
Posts: n/a

Default Re: Can visitors interact with PHP echo functions? - 05-20-2004 , 05:24 PM



craig v wrote:

Quote:
http://www.alistapart.com/articles/phpswitch/


Thanks. I've seen that site, but I'm not sure if a style sheet switcher
can be adapted to an echo function - or how to do it.


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.