PHP - How To Detect The Parent Of An Iframe?
When displaying a webpage within iframe of facebook fan page, how I can detect that my page is viewed within the facebook iframe? I want to have a if else statement to change something within the page if it is viewed through facebook fanpage (not by direct visit).
Similar TutorialsI want to pass button action at the parent page, this button is inside the iframe.
Code: [Select] if ($showigiteidimage) { $igitwid_divlnk = "onclick=location.href='" . get_permalink($igitwid_result->ID) . "'; style=cursor:pointer;"; $igitwid_output .= '<li id="igit_wid_rpwt_li" style="height:' . $igitwid_height . 'px; padding-bottom: 10px;" ' . $igitwid_divlnk . '>'; $igitwid_output .= '<div id="igit_wid_rpwt_main_image" style="float:left;"> <a href="' . get_permalink($igitwid_result->ID) . '" target="_top"><img src="<?php $values = get_post_custom_values("tj_video_img_url"); echo $values[0]; ?>" id="igit_rpwt_thumb" ></a></div>'; the prb is image src cant read the php code , what to do ? please helpppppppppp Hi, Would time() produce the timestamp based on your time environment or the servers?, if it produces the timestamp based on the server; how would I generate a timestamp (which I can later use within date()); so it displays to the users timezone? Ok, so I have a code that looks like so: Code: [Select] <script type="text/javascript"> var ng_config = { assests_dir: 'ng/assets/' // the path to the assets directory } </script> <script type="text/javascript" src="ng/ng_all.js"></script> <script type="text/javascript" src="ng/components/calendar.js"></script> <script type="text/javascript"> var my_cal; ng.ready(function(){ // creating the calendar var my_cal = new ng.Calendar({ input: 'enddate', start_date: 'year - 1', // the start date (default is today) display_date: ng.get('startdate').value, // the display date (default is start_date) server_date_format: 'm/d/Y' // changing the server date format for a specific calendar. }); }); var my_cal1; ng.ready(function(){ // creating the calendar my_cal1 = new ng.Calendar({ input: 'startdate', start_date: 'year - 1', // the start date (default is today) display_date: new Date(), // the display date (default is start_date) server_date_format: 'm/d/Y' // changing the server date format for a specific calendar. }); }); how do I detect the months that pass between the two dates that are selected using a popup calendar using php so that my register page know which month to display the event under. Does this make sense? Hello. Would php be the right thing to use in regards to monitoring changes in html on certain pages, Basicly, I'd need it to be something like: "Page last changed: 2 Days, 4 Hours, 34 Minutes and 13 Seconds ago." What would I use for this? Thanks I am making a demo page that I want to add a form to. The way I want this for to work is. Say you are at demo.com Now you are a client I am working with so I have given you a number. This form will as for that number and on submit it will take you to demo.com/"client number" Here is what I have done. What is in my index.php <form> <form action="search.php"> <input id="button" name="button" type="text" /> <input type="button" value="SEARCH" > </form> What is in my search.php <?php $newurl = "http://demo.mysite.com/"; $newurl .=$_GET['button']; echo "$newurl"; /*header("Location: $newurl"); */ ?> -------------------------------------------------- I have also tried taking out the search.php and having everything in index.php <form> <form> <input id="button" name="button" type="text" /> <input type="button" value="SEARCH" > </form> <?php $newurl = "http://demo.mysite.com/"; $newurl .=$_GET['button']; echo "$newurl"; /*header("Location: $newurl"); */ ?> Hi everyone. I have a small problem. I have a database that shows student images, in the format of 1234.jpg but the file name extension is in both upper case and lower case. My server OS is linux ubuntu. apache2 php5. Linux see these as 2 different file so will not show the upper case ones. 1234.JPG What i have already is working but for lower case only, i need something to detect when the extension is in uppercase and change accordingly. This is what i have now that works for lower case only. <img src=../images/mbr_images/<?php echo H($mbr->getBarcodeNmbr());?>.jpg height=150 width=100 border=1px </img This is what i have tried but gives me a filename of "1234jpg" see the "." is missing? and is still lower case. <img src=../images/mbr_images/<?php echo H($mbr->getBarcodeNmbr()); $image = jpg; $image2 = JPG; if ($image = $image) { echo $image; } else { echo $image2; };?> height=150 width=100 border=1px </img> can anyone offer any help please? TIA Peter i'm trying to use this code to detect if the browser of the user is IE (any version) and id true (if it is IE), then it's redirected to an error page; otherwise, it's ok and sent ot the index. I get the following error... Warning: Cannot modify header information - headers already sent by (output started at /index.php:1) in /xie.php on line 13 any ideas.. ??? <?php function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } if (ae_detect_ie()) { header("Location: error.php"); } else { header("Location: index.php"); } ?> In the site I am making, the client wants one account for everyone (don't ask me why, it's a long, silly reason) And I'm wondering how I would configure mySQL to deal with that (I asked this in the mySQL area) and in PHP (For you guys ) what would I need to put in order for this to work. I'm very new with PHP and mySQL, so please forgive the nooby question. *EDIT* the admins have their own username and psw for adding, deleting, and editing articles. and that works. But all users that register will have this set user and psw displayed to them. I want to make it so they have to log in to see an article. hi i am trying to dectect the user agent and depending on which agent the user is using embed the video a differnt way working fine on my wamp test sever but when i upload to my sever i get this error Warning: get_browser() [function.get-browser]: browscap ini directive not set in Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { echo 'Internet explorer';?> <object width="420" height="360" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="test.avi" /> <param name="controller" value="true" /> <param name="autoplay" value="false" /> <!-- Code For Older Browsers --> <embed src="test.avi" width="420" height="360" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"> </embed> </object> <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE) { echo 'Mozilla Firefox';?> <object type="video/quicktime" data="your file name.avi" width="150" height="250"><param name="Filename" value="test.avi"><param name="AutoStart" value="0"><param name="ShowControls" value="True"><param name="ShowStatusBar" value="False"><param name="ShowDisplay" value="False"><param name="AutoRewind" value="True"> <param name="src" value="./Videos/Security/XPWUA.avi"> <embed src="test.avi" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" filename="test.avi" autostart="0" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True" height="600" width="800"></embed> </object> <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE){ echo 'Google Chrome';?> <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1" height="600" width="800"><param name="Filename" value="./Videos/Security/XPWUA.avi"><param name="AutoStart" value="0"><param name="ShowControls" value="True"><param name="ShowStatusBar" value="False"><param name="ShowDisplay" value="False"><param name="AutoRewind" value="True"> <param name="src" value="./Videos/Security/XPWUA.avi"> <embed src="test.avi" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" filename="test.avi" autostart="0" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True" height="600" width="800"></embed> </object> <?php }else{ echo 'Something else'; } ?> Hi, how can i detect if my website is being open in mobile type all devices instead of computer Please help I was wondering if there was a way or if it's even possible to determine the type of a proxy using php. When I say type I mean http, socks4 or socks5. Using cURL I think it's safe to assume that if a proxy returns a code of 200 then that proxy is good and http, correct? However, how would I go about determining the type of proxies I have in a list, assuming they are good and socks4 and/or socks5? In PHP? Let's say I'm going off of: width x height So this is 2x1 2x1 2 blocks across, 1 block height. How do I check this against other blocks in php to see if the 2x1 will overlap another set of dimensions dynamically? Am I over thinking this? Edited by Monkuar, 24 January 2015 - 12:08 PM. Why does the following code not detect the following file? After I select a file and I click upload, it goes back to the upload form. <?php include_once("includes/config.php"); //grab their type if(!$_COOKIE['user']) { //they are a guest $info = "Guest"; } else { //they are a user $info = $_COOKIE['user']; } if(!$_FILE['file']) { $content = '<form action="submit.php" method="post" enctype="multipart/form-data"> <label for="file">SELECT SKIN:</label> <input type="file" name="file" id="file" /> <input type="submit" name="submit" value="Submit" /> </form>'; } else { if($_FILES['file']['error'] > 0) { $content = "There was an error trying to upload the skin ".$_FILES['file']['name'].".".$_FILES['file']['error']; } } ?> <html> <head> <title><?php $title; ?></title> <link rel="stylesheet" type="text/css" href="theme/style.css" /> </head> <body> <div id="header"> MCSkins </div> <?php echo "Submitting as: ".$info."<br/><br/>".$content; ?> </body> </html> This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=326450.0 Hi, I have tried a lot of different scripts for detect and redirect for device for mobile and they seem to work ok on mac but ie does not load the page are there any scripts that work? I have a main site that sits at the usual www.domain.co.uk address and then i have a mobile site at www.domain.co.uk/phone i want to be able to have nay mobile users when accessing www.domain.co.uk be automaticly redirected to www.domain.co.uk/phone with that working in ie? any help please? thanks, Hi guys, I have this code: <?php // This Code Works if (isset($_POST{"PantryID"})) { Create_Pantry($_POST{"PantryID"}); } // This Code Isn't Working, Keeps Going To 'Else'. if (isset($_POST{"ItemName"})){ Add_Item($_POST{"ItemName"}, $_POST{"ItemWeight"}, $_POST{"ItemPrice"}, $_POST{"ItemDate"}); }else{ echo "Nothing To do"; } ?>
here is the html <label for="PantryID">Create Pantry: </label> <input type="text" id="PantryID" name="PantryID" disabled="true" /> <label for="ItemName">Item Name: </label> <input type="text" id="ItemName" name="ItemName" disabled="true" /> Please help, I can't find any syntax errors. - At the point the PHP is activated it is no longer disabled. the PantryID is set up the same way. Edited September 27, 2020 by jahickiCorrection Basically what the title says, I want to detect a upload and post a notification, how would i do this? |