PHP - Php Iframe
I have an iFrame with a source location of www.google.com. If I browse to another page on Google.com, I can go to it, but cannot obtain the source of the page. Using JavaScript, I can only return the parent location, www.google.com
Is there a way to return the current page URL of an iframe? Another idea is, using PHP, when the iframe makes a request to a new page, is there some way to return the request? Ex: if I browse to google.com/images, can PHP return that the server is trying to request that page? Similar TutorialsHi on my site, i am using an iframe for google maps. When the map comes up it shows markers with information on - part of which is a "clickable" link. Problem is that the url opens in the iframe and i want it to open in a new window coz it goes to a completely different site. I tried putting the target=_blank in different parts of the code, but it just seems to stop everything from working and my google map vanishes ! HERES THE LINE OF CODE THAT I THINK I NEED TO CHANGE } if(v.website != '') { content_string += "<p class='web'>Website: <a href='"+v.website+"'>"+v.website+"</a></p>"; } Can anyone help? - i just want it to open a new window when people click on the hyperlink in the iframe - any suggestions please Brain chatframe.php Code: [Select] <? print "<center><iframe src='chatlog.php' name='chatlogframe' width='350' height='400'></iframe>"; print "<br><br>"; print "<iframe src='menu.php' width='350' height='150' frameborder='0'></iframe></center><br><br>"; ?> But actually im want to be as this as the login page is succesfuly direct to form 2 the iframe will be going below chat screen how can i do that? Cant seem to get this to work. The variable does echo the url. What is the correct way to use the variable inside the iframe? $url = $db->loadResult(); <iframe src="<?php echo $url; ?>"width="450" height="259" frameborder="0" allowfullscreen></iframe> Hello. I'm using a PHP/CGI Upload Script -tesUpload. U can see the uploader at http://www.mintload.com/upload/upload-single.php As you can see, the percentage doesnt reload (its an iframe). On Firefox, if u right click on frame (0%) and select "open frame in new tab" or show only frame, u see it movin' and refreshing. Basically the iframe /fileprog.php calculates the percentage uploaded and refreshes itself to get new percentage every second. The code for upload-single.php is : <?php require_once("upload_helper.php"); $sid = md5(uniqid(rand())); ?> <html> <head> <script language="javascript" type="text/javascript" src="upload.js"></script> <link rel="stylesheet" href="upload.css" type="text/css" media="screen" title="Upload" charset="utf-8" /> <script language="javascript"> function beginUpload(sid) { document.postform.submit(); var pb = document.getElementById("progress"); pb.parentNode.parentNode.style.display='block'; new ProgressTracker(sid,{ progressBar: pb, onFailu function(msg) { Element.hide(pb.parentNode); alert(msg); } }); } </script> </head> <body> <form target="_top" enctype="multipart/form-data" name="postform" action="/cgi-bin/upload.cgi?sid=<?php echo $sid; ?>&target=<?php echo normal_target('receive.php') ?>" method="post"> <div class="inputhead">File 1</div> <input type="file" size="50" name="file_1" /><br/> </form> <div id="progressbox" style="display: none;"><img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."> Uploading now... <div class="progresscontainer"><div class="progressbar" id="progress"></div></div> </div> <iframe src="http://mintload.com/upload/fileprog.php?sid=<?php echo $sid; ?>" width=50 height=50 frameborder=0 border=0 allowtransparency="true" ></iframe> uploaded <!--img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."--> <!--iframe for percentage--> <p align="right"><input type="image" src="http://mintload.com/images/btn_upload.png" onclick="beginUpload('<?php echo $sid ?>');" alt="Upload" ></p> </body> </html> fileprog.php is alright. I need the percentage in iframe to refresh even when embedded onto upload-single.php Please help Thank you. Hi there, i have 3 pages: 1. index.php 2. iframe.php 3. output.php iframe.php is within index.php and in iframe.php there's a form with input fields. Form is including output.php for sending the information. Whenever someone come to index.php, my HTTP_REFERER get's reffer of index.php instead of previously visited page (before my index.php)... how can i fix this? Please help! I'd like to pass a value from a URL to an iframe. This would look as follows: URL: http://www.mysite.com?www.mysite2.com The value (www.mysite2.com) will be an actual web address which should then be inserted into an iframe on www.mysite.com via php. Since I know little to no php, I don't know how the URL has to be structured and what php coding I need to use to include the web address in the iframe. Any suggestions are highly appreciated Hi. I am coding a project, and ability to browse other websites through a frame in this site is central to the project. However, I need to be able to have the href of the frame's current location which I can't do using an iframe. Does anyone know of any techniques using server-side php in which one can view other sites and keep track of the location of the other sides? Thanks, Phil i am tryin to use google map iframe . the $ts4 and $ts5 from the db. Can i generate multiple markers if not can any1 direct me to a link to do so. <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.in/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo "$ts4,+$ts5"; ?>&ie=UTF8&hq=&hnear=<?php echo "$ts4,+$ts5"; ?>&z=14&iwloc=A&output=embed"></iframe> Thanks This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=319436.0 Hello I am curious if it is even possible to get the domain when using iframes/frames? eg. domain2 shows a file from domain1 in an iframe. Can domain1 grab domain name "domian2"? Is there a way of getting a variable from an iframe to the parent? There are many ways to pass a variable from the parent to the iframe, but I'm not sure if you can pass a variable from the iframe back to the parent. When i refresh/update the iframe, i want the updated/new variable "id_no" to be passed to the parent file (so I can put this value in a form field). I tried the code below, but have been unlucky. Code: [Select] document.getElementById("iframe").this.form.id_no.value; Any ideas? I want to pass button action at the parent page, this button is inside the iframe.
I'm having problem with this code. It's supposed to pull a link from a database and feed it into an iframe src to make the video display on screen. I'm getting a white box... It seems like the "address" variable is getting dropped or something, out of scope? here is the code:
<?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ $link = mysqli_connect("localhost", "root", "Mm62Tic8FH", "music"); $rand_num; $rowcount; // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Attempt select query execution $sql = "SELECT * FROM songs"; if($result = mysqli_query($link, $sql)){ // query results stored in "result" if(mysqli_num_rows($result) > 0){ $rowcount = mysqli_num_rows($result); $rand_num = rand(0,$rowcount - 1); $address = "5"; echo "<table>"; while($row = mysqli_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['artist_name'] . "</td>"; echo "<td>" . $row['song_name'] . "</td>"; echo "<td>" . $row['url'] . "</td>"; echo "<td>" . $row['item_id'] . "</td>"; echo "<td>" . $rand_num; echo "</tr>"; if ($rand_num == $row['item_id']) { $address = "https://www.youtube.com/embed/". $row['url']; } echo "----".$address."----"; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> <iframe width="420" height="315" src=<?php $address ?>> </iframe>
Im not sure if this is the correct section so sorry for that in advance, i have this URL on my website inside an iframe: http://gorillavid.com/cna/zwzcpyvcfi7j What im wanting to do is somehow either remove all the ads that are shown, or make sure all of the ads are muted and cant make any noise. is this possible? Seany Hi,
I have a page that carries through cookies and displays a different image/banner depending on the cookies. The URLs look something like: http://www.website.c...gent=agent-name
I now have a page with an iFrame on displaying the URL: http://www.website.c...gent=agent-name
If I access http://www.website.c...gent=agent-name normally, they cookies carry through and the banner shows, but it doesn't if I access it through the iFrame.
Is there a way of carrying the cookies into the iFrame?
Also the URL that the iFrame is on is different to the content of the page inside the iFrame.
Thanks!
Hello,
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). Hello. I'm using a php script to upload file. I've used an iframe inserted on the upload page that refreshes every second/3sec. to display percentage uploaded. forget percentage, lets take a simple example. Presently, my iframe displays last two digits of PHP time() function that change constantly. If you see the live example at: http://mintload.com/upload/upload-single.php The last two digits of time() function are shown and iframe is refreshed every 1 sec. But, the moment one clicks "Upload" button, the file starts uploading, but iframe no more refreshes & freezes. In IE7 it works fine. Why not in Firefox Latest Ver: 3.6 ? code for iframe: Code: (php) [Select] header("refresh:1; $_SERVER[PHP_SELF]"); echo substr(time(),-2,2); My point is, just as in IE, my iframe shouldnt freeze refreshing even if a file is being uploaded. Any code/functions? The problem is taking place in Firefox. Please help. Thank you. Here is the code in question: <form method="post" action="../php/sendmail.php"> <?php function RandomLine() { $textfile = "../messages/compliments.txt"; if(file_exists($textfile)) { $compliments = file($textfile); $string = $compliments[array_rand($compliments)]; } else { $string = "Error"; } return $string; } $line = RandomLine(); echo "<p style='color: red;'>"."$line"."</p>"; ?> <br> <input type="hidden" name="email" value="email@email.com"> <input type="hidden" name="subject" value="random compliment generator"> <input type="hidden" name="message" value="$line"> <input type="hidden" name="to" value="5555555555@mms.uscc.net"> <input type="submit" name="sendtext" value="Send to phone!"> </form> And here is the php from sendmail.php: <?php $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['message']; $to = $_REQUEST['to']; $sent=mail($to, $subject, $message, "From: $email"); if($sent)echo "<br><p>The message was sent!</p>"; else echo "<br><p>There was an error while sending the message.</p>"; ?> When the form from the first bit of code is opened in an iframe, the echo displays the correct code but if the button is sent, the sms/email received simply says "$line". Any ideas? |