Jump to content

antonyfal

Members
  • Posts

    172
  • Joined

  • Last visited

Posts posted by antonyfal

  1. here is the full example:

    it only outputs the first tab and its setting. The other tabs dont show..

     

     

    if(isset($_GET['loadLists']))

    {

    if($needAuth == 1 && !is_logged()) return 'you must be logged in to view this list.';

    $current_user_id = (__isset('multiuser') == 1)?intval($_SESSION['userid']):0;

    $q = $db->dq("SELECT * FROM todo_lists INNER JOIN todo_lists_setting

    ON todo_lists.id=todo_lists_setting.list_id WHERE todo_lists_setting.user_id = '$current_user_id'");

    while($row = mysql_fetch_assoc($q))

    {

    echo '<li id="list_'.$row['id'].'" rel="'.$row['notify'].'_'.$row['showcompl'].'_'.$row['sorting'].'_'.$row['shownotes'].'_'.$row['showdates'].'" class="ytt-tabi"><a href="#list/'.$row['id'].'" rel="'.$row['id'].'" title="'.htmlarray($row['name']).'"><span>'.htmlarray($row['name']).'</span></a></li>';

    }

    }

  2. Hi Jesica..

    I see what you meaning. If i can here something like this:

     

    $result = mysql_query("SELECT * FROM todo_lists INNER JOIN todo_lists_setting

    ON todo_lists.id=todo_lists_setting.list_id WHERE todo_lists_setting.user_id = '$current_user_id'");

    while($row=mysql_fetch_array($result))

    {

    echo '<li id="list_'.$row['id'].'" rel="'.$row['notify'].'_'.$row['showcompl'].'_'.$row['sorting'].'_'.$row['shownotes'].'_'.$row['showdates'].'" class="tab"><a href="#list/'.$row['id'].'" rel="'.$row['id'].'" title="'.htmlarray($row['name']).'"><span>'.htmlarray($row['name']).'</span></a></li>';

    }

     

    is this correct?

  3. Hi.

    I have this simple 2 queries that i am trying to get the output of two table queries syncronised..

     

     

    if(isset($_GET['loadLists']))

    {

        if($needAuth == 1 && !is_logged()) return 'you must be logged in to view this list.';

        else $sqlWhere = '';

        $current_user_id = (__isset('multiuser') == 1)?intval($_SESSION['userid']):0;    

        $q = $db->dq("SELECT * FROM todo_lists $sqlWhere ORDER BY ow ASC, id ASC");

        while($row = mysql_fetch_assoc($q))

        {

        $ncurconfig = $db->dq("SELECT * FROM todo_lists_setting WHERE list_id =? AND user_id=?", array($row['id'], $current_user_id));

        $sett = $mysql_fetch_assoc($ncurconfig);  

        echo '<li id="list_'.$row['id'].'" rel="'.$sett['notify'].'_'.$sett['showcompl'].'_'.$sett['sorting'].'_'.$sett['shownotes'].'_'.$sett['showdates'].'" class="tab"><a href="#list/'.$row['id'].'" rel="'.$row['id'].'" title="'.htmlarray($row['name']).'"><span>'.htmlarray($row['name']).'</span></a></li>';  

        

    }

    }

     

    this should output 4 tabs with different names, and each with their own "rels" settings... Only the first rel is output the other tabs have only "____"..

    I dont know how to join or union queries, but i dont think that they are relevant here?

     

    thanks in advance..

  4. Hi..

    I noticed thAT ONCE an ajax call is sent it will process regardless the page a profile user on my site is on..

     

    What im trying to do is save time for my site user and when data is entered into a form and submited i want the data to appear directly to the table bellow the "new" form in the list form.. This will give the illusion that the data is already processed, and the user can move on.. while the table in the database is processed in the backend..

    I have a seperate function/script that at logout time will only logout when the last ajax call is processed.., But will give the illusion that the profile has logged out by hiding all links..

     

    The only problem i have is the function to parse the form values with selectlists, and inputs to a newly created tr/td row.. before the4 ajax call is made..

     

    example code only as an explanation of what im trying to achieve: If you have other examples you can use those in your explanation if you want.

     

    <script type="text/javascript">

        function get_me(type,ajax_page,value,did,name) 

        { 

     

    <!-- here i want to put a function to parse the form values from "NewForm" to a new row in "ListFormtbl" table, before the ajax kicks in-->

     

    jQuery('#loadingdiv').show();// this will be removed and the process will hapen in the background.

        jQuery.ajax({ 

        type: type, 

        url: ajax_page+name+"="+value,

        dataType: "text/html", 

        success: function(html){

    jQuery('#'+did).html(html); // will be removed as the data will already be view in the table below, while in the background it is processed into the database..

    jQuery('#loadingdiv').hide();// will be removed

        });

    </script>

    <div id="editdiv">

    <form id="NewForm">

    <table width="100%" id="editFormtbl" style="text-align:center">

    </tr>

    <th><label for="name">Street</label></th>

    <th><label for="city">City</label></th>

    </tr>

    <tr>

    <td><input type="text" name="street_description" id="street_description" /></td>

    <td><select name="city" id="city" />

    <option value="City1">city1</option>

    <option value="City2">city2</option>

    <option value="City3">city3</option>

    <option value="City4">city4</option>

    </select>

    </td>

    </tr>

    </table>

    <form>

    </div>

    <br>

    <br>

    <br>

    <div id="listdiv">

    <form id="ListForm">

    <table width="100%" id="ListFormtbl" style="text-align:center">

    <tr>

    <th><label for="name">Street</label></th>

    <th><label for="city">City</label></th>

    </tr>

    <tr>

    <td>Some street</td>

    <td>Some city</td>

    </tr>

    <table>

    </form>

    </div>

     

    Thanks in advance..

  5. Hi thanks for the reply..

    After reading what you wrote-- i think what im needing/wanting is to redirect the original url to the sef url-- for example:

     

    RewriteRule ^preview.html$ index.php?a=k&task=preview

     

    if i type: www.xxx.com/folder1/folder2/preview.html  in the adressbar it works and takes me to the www.xxx.com/folder1/folder2/index.php?a=k&task=preview  page..

     

    but how do i get it to do the reverse:

     

    what i want to do is always have the SEF url diaplyed in the address bar:

     

    so if i type/or click the link:  www.xxx.com/folder1/folder2/index.php?a=k&task=preview it must show the www.xxx.com/folder1/folder2/preview.html  the sef url in the address bar and go to the www.xxx.com/folder1/folder2/index.php?a=k&task=preview page..

     

    whats happening now is: if i type the www.xxx.com/folder1/folder2/index.php?a=k&task=preview the url remains so, and the page loads i just want it to change to the SEF url first

     

  6. Hi, im just figuring out the mod rewrite and htaccess files, im getting a good handle on it, but i have the strange issue: firstly i cant use the

    Options +FollowSymlinks  im guessing its because the server has it enabled by default..

     

    secondly i can type the sef url in the browser and it shows the correct page/s.. but if i click the link (original) on the site or type the originalurl in the address bar, the SEF url doesnt show..

     

    is there a method for redirecting to sef url that i am missing?

     

    this is what i got so far:

     

    RewriteEngine  on

    #RewriteBase /folder1/folder2/

    #RewriteCond %{SERVER_PORT} !^443$

    #RewriteRule ^(.*)$ https://www.xxxxxx.com/$1 [R=permanent]

     

    RewriteRule ^logout.html$ index.php?a=k&jsat=log_out

    RewriteRule ^login.html$ index.php?a=k&jsat=login_form

    RewriteRule ^profile.html$ index.php?a=k

     

    RewriteRule ^preview.html$ index.php?a=k&task=preview

    #RewriteCond %{THE_REQUEST} ^GET\ /folder2/

    #RewriteRule ^newfolder2/(.*) /folder2/$1 [L,R=301]

  7. Hi,

    is it possible and how to do it. I have a onclick="reference to a function" on my parent page. The script for the function on a page located in an iframe. I have control over the domain path..

     

    The onclick looks like this:

     

    <a href="javascript:void(0);" onlick="javascript:chatto('50' ,'john doe');"></a>

    the page can have several links located arround the page with different user names and id's..

     

    the script is located on an iframe page:

    <iframe src="chat.php"></iframe> the chat.php includes the chat.js file.

     

    is this possible and how can i achieve this?

  8. Hi, thanks for the replying..

    here is the outputed Script..

     

    Error: syntax error

    Source Code:

    function OnViewChanged(view){ var ele = document.getElementById("callback");  ele.style.display="block"; elsif (view=="upload") ;ele.innerHTML=""; elsif (view=="manual") ;ele.innerHTML=""; elsif (view=="login") ;ele.innerHTML=""; elsif (view=="contacts") ;ele.innerHTML=""; elsif (view=="captcha") ;ele.innerHTML=""; elsif (view=="bookmark") ;ele.innerHTML=""; elsif (view=="finished") ;ele.innerHTML=""; //error is here

    else ele.style.display="none";}

  9. Hi i have an error in my script syntax error where it is marked.. can you assist?

     

     

    $xhtml .= '<script>';

    $xhtml .= 'function OnViewChanged(view)';

    $xhtml .= '{';

    $xhtml .= ' var ele = document.getElementById("callback");';

    $xhtml .= '  ele.style.display="block";';

    $xhtml .= ' elsif (view=="upload") ;ele.innerHTML="'.htmlentities(get_config('msg.upload',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="manual") ;ele.innerHTML="'.htmlentities(get_config('msg.manual',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="login") ;ele.innerHTML="'.htmlentities(get_config('msg.login',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="contacts") ;ele.innerHTML="'.htmlentities(get_config('msg.contacts',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="captcha") ;ele.innerHTML="'.htmlentities(get_config('msg.captcha',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="bookmark") ;ele.innerHTML="'.htmlentities(get_config('msg.bookmark',''),ENT_QUOTES,'UTF-8').'";';

    $xhtml .= ' elsif (view=="finished") ;ele.innerHTML="'.htmlentities(get_config('msg.finished',''),ENT_QUOTES,'UTF-8').'";'; // syntax error here??

    $xhtml .= ' else ele.style.display="none";';

    $xhtml .= '}';

    $xhtml .= '</script>';

  10. Sorry for that nicely pointed out about the java/javascript

    here is my code again: (the [m][/m] tags have the php symbol on them so honest mistake there)

    <script type="text/javascript">
    var windowtitle = document.getElementById(\''.$username.'id\').innerHTML; // i also used plain text to test this but still get +windowtitle+var 
    
    url_destination = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';
    
    var url_ajax = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';
    
    var online = "<a href=\"javascript:void(0);\" onclick=\"parent.dhtmlwindow.open(\''.$username.'box\', \'div\', \''.$profemail2.'\', \''+windowtitle+'\', \'width=224px,height=227px,left=200px,top=150px,resize=0,scrolling=0,center=1\'); return false\"><font style=\"padding-left:0px; width:100%; background-color:transparent;color:#000000; font-size:11px; text-decoration:none; text-align:left\">CHAT ONLINE</font></a>";
    
    var offline = \'<span style=\"padding-left:0px; width:100%; background-color:transparent; color:#ff0033; font-size:11px; text-decoration:none; text-align:left\">CHAT OFFLINE</span>\';
    
    document.write(\'<\' + \'script type="text/javascript" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chat2.js"></\' + \'script>\');</script>()
    

  11. Hi.

    How can i write this?. I have a page in a iframe it gets the contents of div from parent page, and outputs it to the title of a window script. I cant get to output the javascript var it only shows as +windowtitle+ .

     

    here is my code: (The problem is with window title it outputs as +windowtitle+ )

     

    <script type="text/javascript">

    var windowtitle = document.getElementById(\''.$username.'id\').innerHTML; // i also used plain text to test this but still get +windowtitle+

     

    var url_destination = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

     

    var url_ajax = \'http://'.$host.'/chat/'.$username.'/'.$profemail2.'/\';

     

    var online = "<a href=\"javascript:void(0);\" onclick=\"parent.dhtmlwindow.open(\''.$username.'box\', \'div\', \''.$profemail2.'\', \''+windowtitle+'\', \'width=224px,height=227px,left=200px,top=150px,resize=0,scrolling=0,center=1\'); return false\"><font style=\"padding-left:0px; width:100%; background-color:transparent;color:#000000; font-size:11px; text-decoration:none; text-align:left\">CHAT ONLINE</font></a>";

     

    var offline = \'<span style=\"padding-left:0px; width:100%; background-color:transparent; color:#ff0033; font-size:11px; text-decoration:none; text-align:left\">CHAT OFFLINE</span>\';

     

    document.write(\'<\' + \'script type="text/javascript" src="http://'.$host.'/chat/'.$username.'/'.$profemail2.'/chat2.js"></\' + \'script>\');

    </script>

  12. Hi.

    I have a query that determines if user is online/offline. Works perfectly when page loads. I want to change to auto run query every X seconds.

    NOTES:

    - The query is on a .php page with multiple other queries.

    -IF it is possible to still run the query with-in this page? or make a separate file and include in an iframe? i would like to avoid the iframe and just $output the result of query every X seconds.

     

    Here is my $query code:

    $query = "SELECT `manager_id` FROM #__profiles_xref WHERE profileid = '$profid'";

    $onofflineid=doSelectSql($query,1);

    foreach ($onofflineid as $isonoffline){

    $profmanagerid=$isonoffline->manager_id;

    }

     

    $query = "SELECT `session_id` FROM table_session WHERE userid = '$propmanagerid'";

    $onofflinestatus=doSelectSql($query,1);

    if (count($onofflinestatus)>0)

    {

    $output['PROPSTATUS']='Online';

    } else {

    $output['PROPSTATUS']='Offline';

    }

  13. Hi,

    Doing a Query SELECT * FROM table WHERE field BETWEEN low_number AND high_number

     

    If i have three rows with three numbers: IE: 27, 50, 80.

    and i run the query above, it returns a result of:

    27 and 50.

     

    How can i get it to return a result of:

    27,50, and 80.??

     

    WHY:

    age range search: i want to return an age range of people = and between the age of say: 20 and 70 but i want to include the 20 and 70.

    How can i do this?

     

  14. Hi,

    I don't receive any server errors. :confused:

    The applet i'm using uses class names as id's.  In this case the id is " class="storeCart_items ".

     

    Store cart items loads all the user selections from the cart script into the <div class="storeCart items"> stuff loads here dynaically from user choice<div>. IE: their product selections with price and details.

     

    The email function that loads the user selection and passes it to the email.php to post works on its own without the two lines of code.

     

    If i add these two lines of code: The script just hangs but if i comment out some parts the script posts but it posts the words \" +div.innerHTML+ \" and not the items of the user selection.

     

    //her is snipet from the code:

     

    me.emailCheckout = function() {

    var div = me.updateCartView( document.createElement("div") );

    div = '<div class=\'storeCart_items\'> + div.innerHTML + </div>';

     

    // this line down works the post go through if the top line 2 lines not there.

            var buyersalute = jQuery("#buyersalute").val();

            var buyerfirstname = jQuery("#buyerfirstname").val();

     

      //rest of worm here down works. The me.updateCartView is a function that updates the cart when the user selects items. this function works.

     

        var datastring = 'div=' + div + '&buyersalute=' + buyersalute.......  // this is how the string is passed

     

      //and the post method and criteria here.

     

     

    if i add comments to    ms'>\" +div.innerHTML+ \"</div>"; the email script does not hang but the post for items shows as:

     

    <div class=\"StoreCart_items\">\"  div.innerHTML  \"</div>Success!

     

    instead off the actual items. 

     

  15. Hi kevin.

    I got the posting script running turns out at the end of the day that this part of the script was not working.

     

        var div = me.updateCartView( document.createElement("diver") );

        diver = "<div class='StoreCart_items'>" + div.innerHTML + "</div>";

     

    The strange thing is it works on the original demo script on its own, But loaded into my site and with my own tweks it does nothing. I naturally assumed it was Jquery, cause including the jquery was the only difference between my script in my web page DOM. and the demo version of the script..

     

    this part:

    me.updateCartView( //is a ready function to update the cart. This i know works cause my cart is updated when i select something.

     

    and this part when i add 2 "\" it allows the script to pass but does not pass the cart values only passes->  \"+div.innerHTML+\"

    here is where i add the 2 "\"        _items'>\" + div.innerHTML + \"</div>";

     

    //without it the post doesnt reach the email send. and with it the values do not pass.

    Do you know another way to write this two lines. Or do you need more information.

    Regards

    Tony

  16. HERE IS THE PART NEEDS SOME ATTENTION!!! >:(

     

    The applet i'm using uses classes as id's.  In this case the id is " class=\"storeCart_items "

    Store cart items loads all the user selections from the cart script into the <div class="storeCart items"> stuff loads here dynaically from user choice<div>. IE: their product selections with price and details.

     

    //this is the email function that loads the user selection and passes it to the email.php to post to both user and store admin.

    //the script works but the Var div does not work! when i add the Var div to the posting the script hangs..

    if i add "\" like so:    ms'>\" +div.innerHTML+ \"</div>"; the email script does work but the post for items shows as:

     

    <div class=\"StoreCart_items\">\"  div.innerHTML  \"</div>Success!

     

    instead off the actual items.

     

    var div = me.updateCartView( document.createElement("div") );

        div = "<div class='globalStoreCart_items'>" +div.innerHTML+ "</div>";

     

    //var buyersalute = jQuery("#buyersalute").val();

    //var buyerfirstname = jQuery("#buyerfirstname").val();

     

    And by the way Adam I never once asked you for any personal opinions! you can stick those up your f*cki*g ass!! I asked for some assistance from some who views this post. If you don't want to be part of the solution. Don't post and don't try to piss me off.

     

    For anyone else then who can see something here that could be wrong. If you need more code please let me know.

  17. I pinpointed the problem:

     

     

        var div = me.updateCartView( document.createElement("div") );

        div = "<div class='globalStoreCart_items'>" + div.innerHTML + "</div>";

     

    without this lines of code the form does send--- I tried changing the var names and position in the list of vars but this two lines do not work..

     

    Do you have a Jquery version of the two lines here? These two lines they do work on the demo of the cart script i have to add. But they don work on my site version which didn't change much..

  18. The jquery post does not work! the code might be correct but it doesnt work on my sight: here is my attempt at a ajax post can you help to correct the mistakes here:

     

     

    <?PHP 
    
    if( !isset($_POST['div']) ){
    
    
    
    echo "No items selected";
    
    
    
    return;
    }
    
    
    
    
    $div = $_POST['div'];
    $buyersalute = $_POST['buyersalute'];
    $buyerfirstname = $_POST['buyerfirstname'];
    $buyerlastname = $_POST['buyerlastname'];
    $buyerstreet = $_POST['buyerstreet'];
    $buyertown = $_POST['buyertown'];
    $buyerregion = $_POST['buyerregion'];
    $buyercountry = $_POST['buyercountry'];
    $buyerpostalcode = $_POST['buyerpostalcode'];
    $buyercontact = $_POST['buyercontact'];
    $buyermobile = $_POST['buyermobile'];
    $buyeremail = $_POST['buyeremail'];
    $buyerprefpay = $_POST['buyerprefpay'];
    $buyerspecreq = $_POST['buyerspecreq'];
    $adminemail = $_POST['adminemail'];
    $adminstorename = $_POST['adminstorename'];
    
    $ADMIN_EMAIL 
    
    
    
    = "'.$adminemail.'"; 
    $EMAIL_SUBJECT 
    
    
    
    = "'.$adminstorename.': '.$buyersalute.' '.$buyerlastname.' has placed an order.";
    $BUYER_EMAIL 
    
    
    
    = "'.$buyeremail.'"; 
    $BUYEREMAIL_SUBJECT 
    
    
    
    = "Hello '.$buyersalute.' '.$buyerlastname.' your order details.";
    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    // Additional headers
    $headers .= 'To: <' . $ADMIN_EMAIL . ">\r\n";
    $headers .= "From: \"domain.com\" <https://www.domain.com> \r\n";
    
    $body = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
    
    
    
    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
    
    <html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" lang=\"en-US\">
    
    <head>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" . $EMAIL_SUBJECT . "</title></head><body><table cols="2" width="100%">
    <tr>
    <td colspan="1">Name:</td> <td colspan="1">".$buyersalute." ".$buyerfirstname." ".$buyerlastname."</td></tr><tr>
    <td colspan="1">Store Name:</td><td colspan="1">".$adminstorename."</td></tr><tr>
    <td colspan="2">Address details:</td></tr><tr>
    <td colspan="1">Street:</td> <td colspan="1">".$buyerstreet."</td></tr><tr>
    <td colspan="1">Town: </td> <td colspan="1">".$buyertown."</td></tr><tr>
    <td colspan="1">Region:</td> <td colspan="1">".$buyerregion."</td></tr><tr>
    <td colspan="1">Country:</td> <td colspan="1">".$buyercountry."</td></tr><tr>
    <td colspan="1">PostalCode:</td> <td colspan="1">".$buyerpostalcode."</td></tr><tr>
    <td colspan="2">Contact Details:</td></tr><tr>
    <td colspan="1">Email:</td> <td colspan="1">".$buyeremail."</td></tr><tr>
    <td colspan="1">Phone:</td> <td colspan="1">".$buyercontact."</td></tr><tr>
    <td colspan="1">Mobile:</td> <td colspan="1">".$buyermobile."</td></tr><tr>
    <td colspan="2">Special Requests:</td></tr><tr>
    <td colspan="1">Prefered Payment Method:</td> <td colspan="1">".$buyerprefpay."</td></tr><tr>
    <td colspan="2">Special Requests:</td></tr><tr>
    <td colspan="2">".$buyerspecreq."</td></tr><tr>
    <td colspan="2">Order Details:</td></tr><tr>
    <td colspan="2">".$div."</td></tr><tr>
    </tr></table></body></html>";
    $subject = $EMAIL_SUBJECT;
    
    mail( $ADMIN_EMAIL, $subject, $body, $headers);
    mail( $BUYER_EMAIL, $buyersubject, $body, $headers);
    
    echo "Success! Thank you '.$buyersalute.' '.$buyerlastname.' your order has been placed.<br>A copy of the order details were also sent to this email address: '.$BUYER_EMAIL.'";
    
    
    ?>
    
    

     

     

    here is the ajax:

     

     

     

     

    <script>

    me.emailCheckout = function() {

        var div = me.updateCartView( document.createElement("diver") );

        diver = "<div class='globalStoreCart_items'>" + div.innerHTML + "</div>";

        var buyersalute = getElementById("buyersalute");

        var buyerfirstname = getElementById("buyerfirstname");

        var buyerlastname = getElementById("buyerlastname");

        var buyerstreet = getElementById("buyerstreet");

        var buyertown = getElementById("buyertown");

        var buyerregion = getElementById("buyerregion");

        var buyercountry = getElementById("buyercountry");

        var buyerpostalcode = getElementById("buyerpostalcode");

        var buyercontact = getElementById("buyercontact");

        var buyermobile = getElementById("buyermobile");

        var buyeremail = getElementById("buyeremail");

        var buyerprefpay = getElementById("buyerprefpay");

        var buyerspecreq = getElementById("buyerspecreq");

        var adminemail = getElementById("adminemail");

        var adminstorename = getElementById("adminstorename");

     

    var xmlhttp;

    if (window.XMLHttpRequest)

      {// code for IE7+, Firefox, Chrome, Opera, Safari

      xmlhttp=new XMLHttpRequest();

      }

    else

      {// code for IE6, IE5

      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

      }

    xmlhttp.onreadystatechange=function()

      {

      if (xmlhttp.readyState==4 && xmlhttp.status==200)

        {

        document.getElementById("theResponce").innerHTML=xmlhttp.responseText;

        }

      }

    xmlhttp.open("POST","email.php",true);

    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");

    xmlhttp.send("div=diver&buyersalute=buyersalute&buyerfirstname=buyerfirstname&buyerlastname=buyerlastname&buyerstreet=buyerstreet&buyertown=buyertown&buyerregion=buyerregion&buyercountry=buyercountry&buyerpostalcode=buyerpostalcode&buyercontact=buyercontact&buyermobile=buyermobile&buyeremail=buyeremail&buyerprefpay=buyerprefpay&buyerspecreq=buyerspecreq&adminemail=adminemail&adminstorename=adminstorename");

    };

     

    </script>

     

  19. there's deffinetly something wrong with the posting on this Jquery function and my site-- the posting doesn't work! i have really tried everything i can think of to save the Jquery script- but there comes a time when you have to scrap something and try something else. Plewase can some one help me with an ajax version of this script!- I have waisted too much time here on this Jquery function-- its not going to work on my site-- Sorry for the FA

    NS of Jquery but im sure you had your moments too..

     

    Any takers on an ajax versiion for posting Vars via ajax?

  20. Public link OOOHHH ??!! what you say?? what lol no not yet my site is a surprise site.. Unique.. took me a year to develop..

     

    Listen i have some update news:

     

     

      alert( 'posting stuff 1' ); // if this is a jquery alert type then it works and Adam was correct that the Jquery from the dom does load to the page, also i altered the If jquery !== 'undefined' to  ==='undefined' and the page didnt load. So the Jquery does load...

     

    NOW This is what i did with the alert: i placed it at two point: the first point worked when i selected the checkout. The second point didnt work and nothing below the first point worked.. :

     

     

    me.emailCheckout = function() {

    alert( 'posting stuff 1' );      // here is the first point -- when i clicked the checkout this alert popped up. so the function does work when checkout is pressed...

     

    just for testing i simplified the code from here down--

        var div = me.updateCartView( document.createElement("div") );

        div = "<div class='StoreCart_items'>" + div.innerHTML + "</div>";//  the storecart item does exists and is loaded with info on the purchase

     

     

      alert( 'posting stuff 2' ); here i added the alert second time around and removed the first alert but it never got activated-- and nowhere below the first point..

     

        jQuery.post("//for the email.php page i tried abs url and relative url none worked email.php" , {div:div} , function(data) {

            alert( data );

        });

        eraseCookie('StoreCart');  // and the cookie still exists-- no emails were sent

    };

     

     

    is there something wrong with the div var?? and the post is it absolute or relative url? the div var must send because it contains the data.

    On a page on its own this little script works but in the site dom page nothing-- I also changed the variable names but that didnt work either.. I got one more thing to try ill post back soon.

  21. Hi Adam.

    Its not including the jquery:( nothing i do is working, i will run another test to double check your theory-- ill get back to you on this.. But i just have to say i have tried everything i could think of, and so far no jquery worked-- so i thought Ajax---

     

    heres why it need Jquery direct: the page loads a javascript and if jquery is not defined on the page the page loads the default loading-- here is the JS initializing script:

    //as you can see if jquery is not directly found the default will load-- so either find away to point this jquery to the main jquery-- or scrap jquery leave the default loading and use a ajax equivelent of the function i first posted..

    //this is the original initializing page script

    if( typeof jQuery !== 'undefined' ) $(document).ready(function(){StoreCart.initialize();});

    else if( typeof Prototype !== 'undefined') Event.observe( window, 'load', function(){StoreCart.initialize();});

    else window.onload = StoreCart.initialize;

     

     

    // i need something like this:

    Maybe something like:

    if( typeof jQuery.Global !== 'undefined' ) $(document).ready(function(){StoreCart.initialize();});

    else if( typeof Prototype.Global !== 'undefined') Event.observe( window, 'load', function(){StoreCart.initialize();});

    else window.onload = StoreCart.initialize;

  22. OK! here it is:

     

    Lets not worry about the jquery library versions any more it is no longer an issue Period.

    Whats happening here in my website page is:

    the main index.php loads jquery (GREAT!:) this is what we want) BUT the jquery does not reach the page with the original function:the first function i posted above.

    That page requires the <script>to include the jquery library in the page directly for the page to work</script> BUT!! if i include the jquery library again the page bumms as in the example above +3 posts. SO!! I tried to use Prototype.js to perform the original function posted. BUT!!! prototype also Bummed the page, SO!! Itried to use mootools to perform the original function i posted at the top of the page. BUT!! Mootools also bummed the page.

     

    SO! here we are!

    I have two possible solution that might work to solve this problem. Solution number one:

    is a ajax version of the original function POSTED above.    OR      To point the call to Jquery to the global Script call Which is loaded at the top of my main index.php file anyway..

     

                                                                                                                          BUT!

     

    I HAVE NO CLUE OF EITHER FIX My ajax knowledge is cruddy at best, and how to point the .JS file to the global <script call to the jquery library > well i dont even know if that is possible, and how to achieve it.. I have been playing with some ajax calls : but still the page does nothing:

     

    heres my last attempt to the ajax fix if you want to take a look at it:

    //basically the script mus use the me.emailcheckout to call the function something here is a miss

    me.emailCheckout = function() {

    function ajaxRequest(){

    var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]

    if (window.ActiveXObject){

      for (var i=0; i<activexmodes.length; i++){

      try{

        return new ActiveXObject(activexmodes)

      }

      catch(e){

      }

      }

    }

    else if (window.XMLHttpRequest)

      return new XMLHttpRequest()

    else

      return false

    }

    var mypostrequest=new ajaxRequest()

    mypostrequest.onreadystatechange=function(){

    if (mypostrequest.readyState==4){

      if (mypostrequest.status==200 || window.location.href.indexOf("http")==-1){

      document.getElementById("theResponce").innerHTML=mypostrequest.responseText

      }

      else{

      alert("An error has occured making the request")

      }

    }

    }

        var div = me.updateCartView( document.createElement("diver") );

        diver = "<div class='globalStoreCart_items'>" + div.innerHTML + "</div>";

        var buyersalute=encodeURIComponent(document.getElementById("buyersalute").value)

        var buyerfirstname=encodeURIComponent(document.getElementById("buyerfirstname").value)

        var buyerlastname=encodeURIComponent(document.getElementById("buyerlastname").value)

        var buyerstreet=encodeURIComponent(document.getElementById("buyerstreet").value)

        var buyertown=encodeURIComponent(document.getElementById("buyertown").value)

        var buyerregion=encodeURIComponent(document.getElementById("buyerregion").value)

        var buyercountry=encodeURIComponent(document.getElementById("buyercountry").value)

        var buyerpostalcode=encodeURIComponent(document.getElementById("buyerpostalcode").value)

        var buyercontact=encodeURIComponent(document.getElementById("buyercontact").value)

        var buyermobile=encodeURIComponent(document.getElementById("buyermobile").value)

        var buyeremail=encodeURIComponent(document.getElementById("buyeremail").value)

        var buyerprefpay=encodeURIComponent(document.getElementById("buyerprefpay").value)

        var buyerspecreq=encodeURIComponent(document.getElementById("buyerspecreq").value)

        var adminemail=encodeURIComponent(document.getElementById("adminemail").value)

        var adminstorename=encodeURIComponent(document.getElementById("adminstorename").value)

    var parameters = "div="+diver+"&buyersalute="+buyersalute+"&buyerfirstname="+buyerfirstname+"&buyerlastname="+buyerlastname+"&buyerstreet="+buyerstreet+"&buyertown="+buyertown+"&buyerregion="+buyerregion+"&buyercountry="+buyercountry+"&buyerpostalcode="+buyerpostalcode+"&buyercontact="+buyercontact+"&buyermobile="+buyermobile+"&buyeremail="+buyeremail+"&buyerprefpay="+buyerprefpay+"&buyerspecreq="+buyerspecreq+"&adminemail="+adminemail+"&adminstorename="+adminstorename

    mypostrequest.open("POST", "email.php", true)

    mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded")

    mypostrequest.send(parameters)

    };

     

    something is just a little short..

     

     

     

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.