mootools variable to php.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • diogenes1
    New Member
    • Sep 2009
    • 2

    mootools variable to php.

    i want to use the phatfusion slider via Dreamweaver. But how do I get the value of the slider back into php?

    here is the basic code as installed by Dreamweaver.:

    Code:
    <div id="pf_slider1">
      <div id="pf_slider1_el" class="slideContainer">
        <div id="pf_slider1_Handle" class="slideHandle"></div>
      </div>
      <div class="pos"></div>
    </div>
    <script type="text/javascript">
    // BeginWebWidget phatfusion_slider: pf_slider1_el
    	window.addEvent('domready', function(){
    		var pf_slider1 = new Slider('pf_slider1_el', 'pf_slider1_Handle', {
    			 onTick: function(pos){
    			 this.knob.effect(this.p, {duration: 200, 
    			 transition: Fx.Transitions.quadOut}).start(pos);
    			 },
    		  onComplete: function(val){$('pf_slider1').getElement('.pos').setHTML(val);},
                      mode: 'horizontal',
                      steps: '10'
    		 });	
    		});
    so were do I go from here? i am a fish out of water once I get into ajax.

    I am sure there is a simple answer for those who specialize in this field.

    thank you for you kindest considerations and assistance.

    Cheers.
    Last edited by Dormilich; Sep 3 '09, 07:10 PM. Reason: Please use [code] tags when posting code
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    What I'm seeing is JavaScript, which is run in the browse using the clients PC. PHP is server side and is processed with the hosting servers processor.

    How do you submit data to PHP?

    1. AJAX
    2. Form

    The latter is much easier. Although I don't know much about phatfusion (in fact I've never heard of it), using JavaScript, you can put that value in a form field (a hidden one perhaps) and submit the form to a php page.

    in the PHP page you can grab it with the $_POST variable.

    If any of this doesn't sound familiar, I would look into taking some PHP tutorials.



    Dan

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Check out the Request class for mootools. Send an AJAX request, with the current slider value as data in the request. Then PHP has access to it via the GET array.

      If you do a little googling, you'll find many tutorials on making AJAX requests with mootools.

      Mark.

      Comment

      • diogenes1
        New Member
        • Sep 2009
        • 2

        #4
        I apologize for not being more specific and for my ignorance when it comes to java.
        Yes, I am using it in a form and it will get posted into mySQL.
        Frankly I am not even sure what var to call if I could figure out how to call it?
        I assume the "pf_slider1 ." I know the POS is where the value gets printed out.
        I am having a great adventure learning PHP, SQL, CSS and all the other stuff but when I try to get into Java my brain just goes numb. I can use but not write.
        Watching a Lynda.com video on Ajax is better than a handful of Xanax.
        So my humble abilities are basically 'monkey see - monkey do.'
        I will try the Request reading suggestion. I am using other Mootools functions.
        Thank you very much for your considerations and replies.
        Cheers.

        Comment

        Working...