Jump to content

preetham

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by preetham

  1. Hi. I want to call a PHP function (Defined in a Plugin) I am using this on wordpress by the way. Here is what i want to do. if($width>900) { plugin_function(); }
  2. Thanks.. I am still learning. I thought Logically in regular programming way. Thanks you clarifying . I am trying to check what is the width of the browser. Depending of which i have some action to be done. --
  3. Hi, I have to detect the Browser size in PHP. What is the best way? ---- What i have currently done is, $myWidth = '<script> document.write(window.innerWidth); </script>'; When i echo $myWidth , i get width, But i'm unable to do any function on that. ( ex, if , strcmp ) Also if do strlen($myWidth) i get 72. But echo gives me value "1366" , that lenght can't be 72. I am quite struck up here. Any help appreciated
  4. for storing it on my server, i can use file_exists itself. I'm having issue for remote images. Thanks for the advice, I will check on this asap.
  5. Thanks. This seems to be working fine. However, i see some performance issue, I mean , it takes 3 secs more time now. Is it because of this or something else?
  6. Hi, I am trying to check if image exits on some url, if so then display it. This works fine if I have image locally and use file_exists() When i pass url file_exits(), it fails. Any help appreciated.
  7. I'm not hard coding the link it comes from _GET, so like you said in first post, everything after # is ignored. I wanted to get that.
  8. No Typo. Did you try this code? <?php $mylink = $_GET["link"]; if( stripos($mylink,"Myntra.com")>0) { echo strpos($mylink,"#"); } ?> Bwowser treat "#" differently , this is a know issue. Try this echo (urlencode($mylink)); And when you check output, get this http%3A%2F%2Fwww.myntra.com%2Fsales%3Fnav_id%3D1 # and everything after that is ignored .
  9. Hello, I'm sorry. Actually, I didn't give complete info. This how i actually do it. I send this link as parameter to my file. http://www.myntra.com/sales?nav_id=1#!sortby=PRICEA <?php $mylink = $_GET["link"]; if( stripos($mylink,"Myntra.com")>0) { echo strpos($mylink,"#"); } ?> It doesn't work in this case.
  10. Hi, Both my previous questions were perfectly solved here. Hoping the same this time. Problem :How to find "#" symbol in a String (URL) example : URL = http://www.myntra.com/sales?nav_id=1#!sortby=PRICEA In above link, there is a "#" symbol used, however in code, when i do echo strpos("www.myntra.com/sales?nav_id=1#!sortby=PRICEA","#"); I don't get any value at all. How can i find the pos of "#" in url Thanks in advance.
  11. Ok. Thanks for clearing this
  12. Thanks. I have implemented it and it works just fine. However, i have one thing to take care of, i.e , i want all these external links to open in new window. Can it be done in same js or create new one?
  13. ok. But what is impact if i don't encode first part?
  14. Yes. This solution did work for me, But i think we have to encode whole url. DO we need to encode complete url or just the one you have shown is enough?
  15. here is what it looks like. $tmp = "track.in.omgpm.com/?AID=999&MID=999&PID=999&CID=999&WID=999&UID=999&redirect=".$mylink."?utm_source=OMG&utm_medium=affiliate&utm_campaign=AID&aff=K5MHQM6"; I need to encode this and forward to this address. Please help
  16. @2260419 This works like a charm.. Thanks a ton
  17. It doesn't work Please someone help. I'm using urlencode, i think it related to that.
  18. @2260419 THanks for your reply. Now, where should i put in the javascript ? I am using wordpress Should i put in /wp-includes/js ? Also, i am facing an issue in redirect.php part. please read this thread. http://forums.phpfreaks.com/topic/280216-remove-new-line-from-encoded-url-string/
  19. Thanks for repying. However, str_replace() is not working for me. I tried these, both didn't work str_replace("\r", '', $loc); str_replace("\n", '', $loc);
  20. Hello, Code: <?php $mylink = $_GET["link"]; $final_link = $mylink; if( strpos($mylink,"test")>0) { $tmp = "mystring1".$mylink."mystring2"; $final_link = urlencode($tmp); $loc = "Location: ". $final_link; echo $loc; //header($loc); exit(); } ?> I have written above php code, problem is, when i echo "loc" i get this 1st line : Location: 2nd line : http So, when i do header($loc), i adds "/" in between Location and http and page won't be forwaded. Please help.
  21. Hello, This is my first post here, i am really hoping to get some solution here. I had technical difficulty building my website. My Requirement, (i'm using wordpress) When i post an external link say "www.external.com". I want it to be automatically converted to something like this "www.mysite.com/redirect.php?www.external.com". Later depending on which site is "external" i will edit id and redirect. Can anyone help me with this.
×
×
  • 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.