Im trying to get javascript and php to communicate...Ive got a sortable list
(using Interface and jQuery) and I have a serialize function running to
check updates to the list. This serialized hash is returned as so:
"sort_me[]=sort9&sort_me[]=sort10"....and so on. What I want to do is send
that string to a php file (using jQuery's load() function) and have the php
script get the order of the elements (sort9, sort10, etc) and insert them
into a MySQL database. The problem is that the hash from jQuery is returned
as I posted above, and which gets cut off for some reason. So my question
is, how can I get a list, say seperated by commas (ie.
sort10,sort9,sort11...), from jQuery that PHP can understand.

my js code:

function serialize(id){ 
serial= $.SortSerialize();
myserial= serial.hash;
mypage= "message.php?name=&message="+myserial; 
$("#feeds").load(mypage); 
}; 

$("#sort_list").click(function(){ serialize("sort_me"); });

and php code:

<?php echo $name; echo $message; ?>

and html code:

<div id="feeds" style="width: 500px"></div>
<div id="sort_list">
# Serialize 
</div>
<ul class="sortable" id="sort_me" >
<li class="sortableitem" id="item9">sortable 2 item 9</li>
<li class="sortableitem" id="item10">sortable 2 item 10</li>
<li class="sortableitem" id="item11">sortable 2 item 11</li>
<li class="sortableitem" id="item12">sortable 2 item 12</li>
</ul>
-- 
View this message in context: 
http://www.nabble.com/Communicating-with-PHP-tf2729766.html#a7613842
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to