Jump to content

antonyfal

Members
  • Posts

    172
  • Joined

  • Last visited

Everything posted by antonyfal

  1. Can you solve one? one is a ajax problem which if sloved helps me too. The other is a jquery problem which if solved helps me too they just happen to have the same example thats all two different problems.
  2. I got this in the Javascript which initialises the page function based on Prototype or Jquery: If i can get it to check global jquery before load we will have success:(I think): 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; 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; So it will look for the Jquery in the mainindex of the example above-- This will solve the issue too. How can i do this?
  3. Heres why: I cant use the <script>include any version jquery in the page</script> Cause this is how the page is formed: main index.php Main index.php also has <script>jquery 1.4--</script>{ page with menu Page with header page1 (ancor jquery tab) page2 (ancor jquery tab) page3 (ancor jquery tab) page4 (ancor jquery tab) page5 (ancor jquery tab) page6 (ancor jquery tab) page7 (ancor jquery tab) page8 (ancor jquery tab) OUrpage(ancor store jquery tab) if i use the Jquery <script>include jquery here any version</script> The jquery tabs break:( and the page does not work - - } So as you can see the page does have jquery loaded, but it doesnt work on our page- Our page requires it direct into the page. What i have tried besides Jquery is: mootools, prototype, all conflict when i include them.. So now i am at a final attempt at a ajax xml call WHICH is not conflicting anything but is also not working if you can take a look at this post to maybe help there? http://www.phpfreaks.com/forums/index.php?topic=349516.0 this will solve my problem.. OR Regards Antony
  4. Here is my full code: email.php <?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.'"; ?> Ajax call: <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>
  5. take a look here: if you can puzzle this one! http://www.phpfreaks.com/forums/index.php?topic=349516.0 it will solve my problem. I m not using Jquery and Prototype just looking for a simple normal ajax function. Mootools Bumms out, prototype bumms out, jquery bumms out-- so my last attempt is the basic ajax flat no anything else xml request.. OF!!! WHICH I KNOW ABSOLUTELY NOTHING BUT THINK IM ON THE RIGHT TRACK HERE__ http://www.phpfreaks.com/forums/index.php?topic=349516.0 Let me know
  6. Hi, here is some stuff i been trying out. I cant get it to work-- i don't even get an error cause the server doesn't recognize my script . Please all i want to do is post this variables to the email.php page. if you can you see something wrong here please correct it. 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"); };
  7. Hello. I have this code which works on a page on its own, But on my site it does not work. The Jquery does not load and i have also tried Prototype. It too conflicts.. here is my function, when the button is presssed the following is supposed to happen, but i have problems with the jquery. YES! i have tried the noConflict.. Here is my code: me.emailCheckout = function() { var div = me.updateCartView( document.createElement("diver") ); diver = "<div class='storeCart_items'>" + div.innerHTML + "</div>"; var buyersalute = jQuery("#buyersalute").val(); var buyerfirstname = jQuery("#buyerfirstname").val(); var buyerlastname = jQuery("#buyerlastname").val(); var buyerstreet = jQuery("#buyerstreet").val(); var buyertown = jQuery("#buyertown").val(); var buyerregion = jQuery("#buyerregion").val(); var buyercountry = jQuery("#buyercountry").val(); var buyerpostalcode = jQuery("#buyerpostalcode").val(); var buyercontact = jQuery("#buyercontact").val(); var buyermobile = jQuery("#buyermobile").val(); var buyeremail = jQuery("#buyeremail").val(); var buyerprefpay = jQuery("#buyerprefpay").val(); var buyerspecreq = jQuery("#buyerspecreq").val(); var adminemail = jQuery("#adminemail").val(); var adminstorename = jQuery("#adminstorename").val(); var datastring = '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; jQuery.ajax({ type: "POST", url: "http://www.domain.com/php/email.php", scriptCharset: "utf-8", contentType: "application/x-www-form-urlencoded; charset=UTF-8", data: datastring, success: function(data) {alert(data);} }); eraseCookie('storeCookie'); };
  8. OK no!! prototype also conflicting with my site -- i scrapped this !! the user must have paypal or google.. or shop some where else
  9. sorry Adam my bad. It doesn't matter the version jquery any more.. I cant use the script tag in my html page period, as it bums my site. Any version of jquery. If i do a source check of the entire page (consiting of modules and components) i see that jquery is loaded already. BUT the script above doesnt call to the jquery period it just happens the the version that is loaded on the mainframe is 1.4.xx. I did a check with the two version together and both work with the function above. BUT on the page on its own, not when i view the page through my site preview. BUT you got a plan there. How would i point the abopve function to use the main Jquery 1.4xx ? so that i dont have to include it in the html page as well.
  10. Hi Adam. what do you mean by: "modify the external script tag" and how would i do that?
  11. Hi Thorpe.. Heres my problem: <script type="text/javascript" src="http://www.mydomain.com/javascript/jquery-1.4.3.min.js"></script> I cant include this file cause its alreday included in my index.php file. If i do include the file again where the script requires it Jquery doesnt load period. Is there a fix to include it more then once? or is it possible to get a prototype function to achieve the same result above? regards Antony
  12. Hi, Im not getting any errors. I did some further checks. The code above does work with either version of Jquery. I am looking into the code for another way to do this. Maybe im missing something.. Ill post again if i find a solution. But for now the code above works.
  13. Its my lucky day Thorpe. I see you also on github. This is the topic: https://github.com/wojodesign/simplecart-js/issues/84#issuecomment-3056269 I have followed everything on this topic and when i hit the checkout button nothing happens.. Im missing something.. I cant include the jquery as its already included on the page, everything works except the email checkout function.. Please can you take a look.. On this page i followed everything by the book. I use 2.2
  14. Hi i got a script that requires jquery 1.3.2.min.js, but when i include the 1.3.2.js my site does not work. When i check the included scripts i see that i already have 1.4.3.min.js on the page where i need this script to function. But without the 1.3.2.min.js the script does not work. So how can i upgrade it to use with 1.4.3.min.js ? here is code: me.emailCheckout = function() { var div = me.updateCartView( document.createElement("diver") ); diver = "<div class='Cart_items'>" + div.innerHTML + "</div>"; var name = jQuery("#name").val(); var adress = jQuery("#adress").val(); var datastring = 'div=' + diver + '&name=' + name + '&adress=' + adress; jQuery.ajax({ type: "POST", url: "email.php", scriptCharset: "utf-8", contentType: "application/x-www-form-urlencoded; charset=UTF-8", data: datastring, success: function(data) {alert(data);} }); eraseCookie('Cart'); };
  15. Thanks a stack Pikachu2000. This is exactly what i was looking for. I can work it out from here.. I will post my result here when i get it!. My site is slightly different cause i use pattemplates. But this solution will work. Thanks again. Best regards Antony
  16. Hi, Im back i did some more research for examples based on what you showed me.. I again viewed 60++ email form examples, a couple of login examples a couple of validation scripts, but i cant find what im looking for!!: I dont think Ajax can help me! or ...? All ajax does is give a responce to your input! or validate thats all i find validation and email... I havent found one single example for what i need. And to me it seems like something that should be basic to do!!! Here is a working sample of my current code: (WHICH IS PHP) all im trying to do is! make it so that the page does not reload! SEE below //heres my form <div><form method="post" action="#" name="presearchform" > <center><table width="50%" style="border:1px solid #444444"> <tbody><tr><td colspan="1">Gender:</td><td colspan="1"><select name="searchgender" id="searchgender" class="inputbox"> <option value="Male">Male</option> <option value="Female">Female</option> </select></td></tr><tr><td colspan="2" style="text-align:right"><input type="image" value="Submit" name="Submit" alt="Submit" src="search.png"> <input type="hidden" value="1" name="postintegratedsearch"></td></tr> </tbody></table></center> </form><br></div> //heres the php part <?php if ($_POST['postintegratedsearch'] == '1') { blah blah blah } If ($_POST['searchgender'] == 'Male'){ blah blah blah } // anf then further down i may have another If ($_POST['searchgender'] == 'Male'){ blah blah blah } // and then another but this one will be for female!! If ($_POST['searchgender'] == 'Female'){ blah blah blah } ?> How would i use the example you gave me to make this work for example? If ($_POST['searchgender'] == 'Male'){ blah blah blah }
  17. Hi sunfighter, Thanks for the response.... The direction you are taking me, although 100% on the right track, is way on the other-side of what i had in my mind.. I see where you going now... could you give me an example of the "iffy" function? Like just a small complete function example? and would this function be in .php or javascript?
  18. Hello. I want to get the server ajax request and turn it into a variable which i can use in If statements. FOR EXAMPLE: <?php some php code here, mostly some calls to ready made functions ?> //this is part of our ajax/javascript calls and html form (I got this example from the net) ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ // here we say to put the ajax responce into a id with name time.. as value..blah blah document.myForm.time.value = ajaxRequest.responseText; } } ajaxRequest.open("GET", "serverTime.php", true); ajaxRequest.send(null); } //here is the actual form //--> </script> <form name='myForm' method="post"> Name: <input type='text' onChange="ajaxFunction();" name='username' /> <br /> Time: <input type='text' name='time' /> //here is the id(or name) time where the ajax responce is used as value ... </form> </body> </html> //HERE IS WHERE MY QUESTION LIES: <?php If this was all php without ajax i would submit the form to self, the page would reload and my post/get would be picked up, and i could use them in if statements like so: if ($_GET['time'] == '12:00'){ $thedaytime='Afternoon'; } else { if ($_GET['time'] == '18:00'){ $thedaytime='Evening'; } else { if ($_GET['time'] == '00:00'){ $thedaytime='Its past your bed time'; } } } ?> HERE IS MY QUESTION!!!!! How can i Manipulate the "echo" result that i get from a ajax response so that i can change it into a variable so that i can use them in the if statements like the example above??? something like so: if (echo result of ajax == '00:00'){ $thedaytime='Its past your bed time'; } any help! best regards Tony
  19. Hi, I am trying to output my data call rows, alongside each other till two, then break and start a new row. and so on and so on. this is not really a example question, i think its more a request information question and example question. How would i go about $outputting the rows alongside each other? i have tried: $output_rows['MYDATA']='then in here i have had a complete table with all the css and styling and information entered'; //but i couldn't get it alongside each other on the html page? then i tried outputting the information and had the tables and css setup on the .html page, but that gave me duplicate entries alongside each other, as no i was entering data from the {MYDATA}.. Twice.. I am really stuck! if any one can assist Great.
  20. here is an actual example where i use the explode function-- problem is when i try to use it on another page it doesnt work. Is there a better way to do this: regardless of if there is a / or a & in the url.. $getstheurl = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $dontshowurl=explode("/", $getstheurl); $findtheurl=explode('&', $getstheurl); $findtheurl = array_unique($findtheurl); sort($findtheurl); foreach($findtheurl as $foundtheurl) if ($foundtheurl == 'gender=Female' && $foundtheurl !== 'gender=Male' && $foundtheurl !== 'Agency' || $_POST['searchgender'] == 'Female' && $_POST['searchgender'] !== 'Male' && $_POST['searchgender'] !== 'Agency'){ $style='<link rel="stylesheet" type="text/css" href="'.$templateUrl.'/css/templatefemale.css" />'; } else { if ($foundtheurl == 'gender=Male' && $foundtheurl !== 'gender=Female' && $foundtheurl !== 'Agency' ||$_POST['searchgender'] == 'Male' && $_POST['searchgender'] !== 'Female' && $_POST['searchgender'] !== 'Agency'){ $style='<link rel="stylesheet" type="text/css" href="'.$templateUrl.'/css/templatemale.css" />'; } else { if ($foundtheurl !== 'gender=Female' && $foundtheurl !== 'gender=Male' && $foundtheurl == 'Agency' || $_POST['searchgender'] !== 'Female' && $_POST['searchgender'] !== 'Male' && $_POST['searchgender'] == 'Agency'){ $style='<link rel="stylesheet" type="text/css" href="'.$templateUrl.'/css/templateagency.css" />'; } else { if ($foundtheurl !== 'gender=Female' && $foundtheurl !== 'gender=Male' && $foundtheurl !== 'Agency' || $_POST['searchgender'] !== 'Female' && $_POST['searchgender'] !== 'Male' && $_POST['searchgender'] !== 'Agency'){ $style='<link rel="stylesheet" type="text/css" href="'.$templateUrl.'/css/templatenormal.css" />'; } } } }
  21. Thanks again for the replies Ryan. I see i can use the code that you gave for the URL in this example, it will work great.. But what im looking for is a way to see if there are any specific words in the url, and then load parts of that page according to if the word is in the url or not. I use the explode function and explode the url in parts IE "/" or "&" or .... for example, but then i always have to know the parts and their positions IE: parts[0]='www.xxx.com'; if (parts[6] !=='someword'); is there not a better way to do the url thing regardless of the "/" or "&".. and without the get function? like matching words to parts of a string, without the explode or the $GET? when i saw the fix you gave me for my problem above i thought that there must be a better way for the url problem too. this explode function i have works on some and doesnt work on others and to be honest is a headache. i think what im looking for is a way to find if a word IS! or ISN'T in the url-- the word can be a user post or a variable. Also a way that will work 100% of the time and faster to load too. if you can assist me with this great, otherwise im quite happy with what i got so far. Best regards Antony
  22. Thanks Ryan. This worked perfectly.. my end result was written like this: $bannedemailwords=array('customerinformation','custinfo','customerinfo','custtext','custsupport','customersupport','admin'); if (!in_array(''.$_POST['cfg_enablemyemailappaddress_enable'].'', $bannedemailwords) { then the rest.. I was wandering if you knew a better way for this code too? in this example the url explodes at the "&" but i was trying out several ways to include more if statements if the url explodes at the "/" too. also i dont always know the position of the specific word im looking for.. and to honest im not really sure this code actually works-- somtimes it does and sometimes it doesnt.. depends the page that is loaded. $geturl = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $findurl=explode('&', $geturl); $findurl = array_unique($findurl); sort($findurl); foreach($findurl as $foundurl) if ($foundurl == 'Female' )
  23. Thanks ill give it a try and post my findings..
  24. Hi, i have tried everything i can think of to get this to work correctly. What is below here, is what i have last tried to work with..: basically the script allows the use to register an email account on a cpanel domain. Everything works perfectly but then i added a option for banned words now i cant get the script to work.. basically what happens is: the user creates an email account, if the account is not a banned word and does not exist, then the message echoes success, and the $_Post values are also entered into the database under the users name. and the email is also created with the $f fopen if success the email form also does not show.. so only one email per user.. i just cant get it to work with the banned words included.. what to note:: this is a function in a function.. $bannedemailwords='customerinformation,custinfo,customerinfo,custtext,custsupport,customersupport,admin,accounts'; $bannedmail=explode(',', $bannedemailwords); $bannedmail = array_unique($bannedmail); sort($bannedmail); foreach($bannedmail as $noemail) //the selected username if ($Config['enablemyemailapp_enable'] == '0' && $_POST['cfg_enablemyemailappaddress_enable'] !== $noemaill && $_POST['cfg_enablemyemailappaddressdomain_enable'] !== 'Select a domain'){ $cpuser = 'ausername'; $cppass = 'apassword'; $cpdomain = 'adomain'; $cpskin = 'askin'; $epass = 'somepassword'; $equota = 'somequota'; $euser = $_POST['cfg_enablemyemailappaddress_enable']; $epass = $_POST['emailspassword_enable']; $edomain = $_POST['cfg_enablemyemailappaddressdomain_enable']; if (!empty($euser) && $euser !=='nomail') while(true) { $f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$edomain&password=$epass&quota=$equota", "r"); if (!$f) { $enablemyemailapp_enable = '0'; $enablemyemailappaddress_enable = 'Replace with a Name'; $enablemyemailappaddressdomain_enable = 'Select a domain'; $msgemail = 'The email '.$euser.'@'.$edomain.' is a restricted email account.'; break; } $enablemyemailapp_enable = '1'; $enablemyemailappaddress_enable = $_POST['cfg_enablemyemailappaddress_enable']; $enablemyemailappaddressdomain_enable = $_POST['cfg_enablemyemailappaddressdomain_enable']; $msgemail ='<center><font color="#ff0033">Your Email '.$euser.'@'.$edomain.' has been created.</font></center>'; while (!feof ($f)) { $line = fgets ($f, 1024); if (ereg ("already exists", $line, $out)) { $enablemyemailapp_enable = '0'; $enablemyemailappaddress_enable = 'Replace with a Name'; $enablemyemailappaddressdomain_enable = 'Select a domain'; $msgemail ='<center><font color="#ff0033">The email account '.$euser.'@'.$edomain.' already exists.</font></center><br><center>Please try again!</center>'; break; } } echo $msgemail; $_POST['cfg_enablemyemailapp_enable']= $enablemyemailapp_enable; $_POST['cfg_enablemyemailappaddress_enable']=$enablemyemailappaddress_enable; $_POST['cfg_enablemyemailappaddressdomain_enable']=$enablemyemailappaddressdomain_enable; @fclose($f); break; } }
  25. Hi, i tried a couple of attempts but im not getting any luck! here is one of the attempts, why is it not working? <script type="text/javascript"> function getCookie(mailaddress) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies.substr(0,ARRcookies.indexOf("=")); y=ARRcookies.substr(ARRcookies.indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==mailaddress) { var thisemail=y; } var email_split=thisemail.split("@"); var email_name=email_split[0]; var email_domain=email_split[1]; } } </script> <input size="20" class="text" name="_username" type="text" value="<myCookie: var email_name />" readonly>
×
×
  • 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.