PHP - Loading A Webpage Inside A Frame
i want help on how to load a page inside a frame.
Similar TutorialsCode: [Select] <? print "<br><br><br><br>"; print "<center><iframe src='chatlog.php' name='chatlogframe' width='370' height='400'></iframe>"; print "<br><br>"; print "<iframe src='menu.php' width='385' height='150' frameborder='0'></iframe></center><br><br>"; ?> Screenshots the square that i draw in that picture im want it to be the main frame and the 2 iframe source to be put in this frame how can i do that? Hello , Im trying to make a very simple link trade script , which checks in a page exists and after searches to that page to find a link (in this case my link). But i got stuck in the lalst step of finding my link on a given page. Hope you can help me with that Code: [Select] <?php require_once('Connections/my_conn.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $myurl= 'http://mywebsite.com'; //check if the remote site url exists function url_exists($url) { $ch = @curl_init($url); @curl_setopt($ch, CURLOPT_HEADER, TRUE); @curl_setopt($ch, CURLOPT_NOBODY, TRUE); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $status = array(); preg_match('/HTTP\/.* ([0-9]+) .*/', @curl_exec($ch) , $status); } //check if my link exists in the remote site if(($status[1] == 200) && ($myurl== )); { //Insert into database code here } ?> I would like a little help on how to check if my link exist in the trader's url. Thanks in advance I'm trying to figure out why the options aren't appearing inside the select dropdown. Any ideas why? Code: [Select] echo "<label for=" . $row2['fullName'] . ">" . $row2['fullName'] . "</label>"; echo "<select name=" . $row2['fullName'] . " id=" . $row2['fullName'] . " class=dropdown title=" . $row2['fullName'] . " />"; if ($styleID == 1 || $styleID == 2 || $styleID == 6) { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID = 3 ORDER BY characters.characterName"; $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query while ( $row3 = mysqli_fetch_array ( $charactersResult, MYSQL_ASSOC ) ) { print "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r"; } } else { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID IN (1,2,6) ORDER BY characters.characterName"; $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query while ( $row3 = mysqli_fetch_array ( $charactersResult, MYSQL_ASSOC ) ) { print "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r"; } } echo "</select>"; } try { echo "<br>"; foreach($dbh->query("SELECT * FROM test_shot WHERE sold=1 ORDER BY year ASC") as $row) { if($row['picture'] != "" && $row['picture'] != null) { echo "<div class='image-holder'><img src ='".$row['picture']."' width=300px /><br>"; } if($row['year'] != "" && $row['year'] != null) { echo $row['year']; } if($row['description'] != "" && $row['description'] != null) { echo $row['description']; } if($row['sold'] == 1) { echo "<img src='images/sold1.png'><br>";//Add your image code here } elseif ($row['sold'] == 0) { echo "</div><br>"; } } } catch (PDOException $e) { print $e->getMessage(); } ?>
The Script:
$desired_width = 110; if (isset($_POST['submit'])) { $j = 0; //Variable for indexing uploaded image for ($i = 0; $i < count($_FILES['file']['name']); $i++) {//loop to get individual element from the array $target_path = $_SERVER['DOCUMENT_ROOT'] . "/gallerysite/multiple_image_upload/uploads/"; //Declaring Path for uploaded images $validextensions = array("jpeg", "jpg", "png"); //Extensions which are allowed $ext = explode('.', basename($_FILES['file']['name'][$i]));//explode file name from dot(.) $file_extension = end($ext); //store extensions in the variable $new_image_name = md5(uniqid()) . "." . $ext[count($ext) - 1]; $target_path = $target_path . $new_image_name;//set the target path with a new name of image $j = $j + 1;//increment the number of uploaded images according to the files in array if (($_FILES["file"]["size"][$i] < 100000) //Approx. 100kb files can be uploaded. && in_array($file_extension, $validextensions)) { if (move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) {//if file moved to uploads folder echo $j. ').<span id="noerror">Image uploaded successfully!.</span><br/><br/>'; $tqs = "INSERT INTO images (`original_image_name`, `image_file`, `date_created`) VALUES ('" . $_FILES['file']['name'][$i] . "', '" . $new_image_name . "', now())"; $tqr = mysqli_query($dbc, $tqs); // Select the ID numbers of the last inserted images and store them inside an array. // Use the implode() function on the array to have a string of the ID numbers separated by commas. // Store the ID numbers in the "image_file_id" column of the "thread" table. $tqs = "SELECT `id` FROM `images` WHERE `image_file` IN ('$new_image_name')"; $tqr = mysqli_query($dbc, $tqs) or die(mysqli_error($dbc)); $fetch_array = array(); $row = mysqli_fetch_array($tqr); $fetch_array[] = $row['id']; /* * This prints e.g.: Array ( [0] => 542 ) Array ( [0] => 543 ) Array ( [0] => 544 ) */ print_r($fetch_array); // Goes over to create the thumbnail images. $src = $target_path; $dest = $_SERVER['DOCUMENT_ROOT'] . "/gallerysite/multiple_image_upload/thumbs/" . $new_image_name; make_thumb($src, $dest, $desired_width); } else {//if file was not moved. echo $j. ').<span id="error">please try again!.</span><br/><br/>'; } } else {//if file size and file type was incorrect. echo $j. ').<span id="error">***Invalid file Size or Type***</span><br/><br/>'; } } }Hey, sorry that I am posting this darn image upload script again, I have this almost finished and I am not looking to ask more questions when it comes to this script specifically. With the script above I have that part where the script should store the ID numbers (the auto_increment column of the table) of the image files inside of one array and then the "implode()" function would get used on the array and then the ID numbers would get inserted into the "image_file_id" column of the "thread" table. As you can see at the above part the script prints the following: Array ( [0] => 542 ) Array ( [0] => 543 ) Array ( [0] => 544 )And I am looking to insert into the column of the table the following: 542, 543, 544I thought of re-writing the whole image upload script since this happens inside the for loop, though I thought maybe I could be having this done with the script as it is right now. Any suggestions on how to do this? This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=316454.0 I'm trying to pull results from a database (using php) to populate a javascript "top news rotation" script I found. The problem is that I'm getting the "java is disabled" message that is in the code...instead of the results I'm expecting. Here's the code: Code: [Select] <!-- create a element in your HTML like the following --> <div id="quotetext" > Text will go here. Be sure to add initial text here for users with JavaScript disabled. </div> <!-- The easiest way is to place the below JavaScript code after the above HTML. The better way would be to add in the <head> section of the document and call the rotatequote() function through the window.onload event. However this can cause problems if you have other scripts that use the window onLoad settings --> <script type="text/javascript" > var myquotes = new Array( <?php $link = mysql_pconnect($host, $username, $password); mysql_select_db('briansch_brn',$link); $sql = "SELECT * FROM story WHERE ORDER BY date DESC LIMIT 4"; $rs = mysql_query($sql,$link); $matches = 0; while ($row = mysql_fetch_assoc($rs)) { $matches++; echo "'<strong>$row[headline]</strong><br />(posted $row[date]) - $row[short_story]<br /><a href='/pages/$row[keyword]'>READ MORE</a>'"; if($matches < 4) { echo ','; } if($matches == 4) { echo ''; } } if (! $matches) { echo (""); } echo ""; ?> ); function rotatequote() { thequote = myquotes.shift(); //Pull the top one myquotes.push(thequote); //And add it back to the end document.getElementById('quotetext').innerHTML = thequote; // This rotates the quote every 10 seconds. // Replace 10000 with (the number of seconds you want) * 1000 t=setTimeout("rotatequote()",10000); } // Start the first rotation. rotatequote(); </script> I know that javascript inside php is hard to make work...and I know that php inside javascript is hard to make work. Any ideas? Thanks! Hi. I found this code for my website, and it work well. Its just that there comes some text I wan't to delete. Code: Code: [Select] <?php /* index.php */ Session_start(); if($_SESSION['login'] == false) { header("Location:login.php"); } $a = $_GET['a']; $source='http://****.elementfx.com/test.php'; //$source='sample.txt'; $page_all = file_get_contents($source); $div_array=array(); preg_match_all('#<div id="intro">(.*?)</div>#sim', $page_all, $div_array); //print_r($div_array); ?> <html> <head> <title>Home</title> </head> <body> <center> <p><b><font color="blue" size="20">*****</font></b> <font color="blue" size="2">version 0.9_01</font></p> <br/> <br/> <br/> <textarea cols="50" rows="10"><?php print_r($div_array[1]);?></textarea> </center> </body> </html> The text it should get is: Quote Hello I'm Something! <p>asdoasduiasdasnda</p> asdasdaksdjas<br/> sdffdsg But the output is: Quote Array ( => Hello I'm Something! <p>asdoasduiasdasnda</p> asdasdaksdjas<br/> sdffdsg ) I need to get rid of the Array( ... thing.. Regards Worqy Hy guys I try to rebuild a PTC site The thing is when the member is click on the ad, they get money after x sec. I have the code, and the question is how i can remove the top frame, but i would like to keep the money part. So when they open a link its will looks a normal link no frame no timer but they still get the monye after x second. Can i do this?? The code is he <? session_start(); /********************************************************************************************************************************************** ScriptBux Version 2.50 beta This Script has been created and coded by Gabrola and edited by hassan ahmady. If you find any bugs in the script report at support@thealternatif.info or contact hassan ahmady. Copywrite ScriptBux 2008; Please make donations if you use this sript for commercial use to My paypal account "bisnis-usd@plasa.com" ************************************************************************************************************************************************/ require('config.php'); global $c; require('data.php'); global $config; require('funciones.php'); $adse=securedata($_GET["ad"]); if(isset($_GET['example'])) { die("<body bgcolor='#FFFFFF'></body>"); } if(!$_GET['ad']) { die("<b>Error</b> - You need the advertisement ID."); } if(!isset($_COOKIE["usNick"]) && !isset($_COOKIE["usPass"])) { $sqlz = "SELECT * FROM ads WHERE ad_id='$adse'"; $resultz = mysql_query($sqlz); $myrowz = mysql_fetch_array($resultz); if(!$loggedin) { $numero=$myrowz["outside"]; $sqlex = "UPDATE ads SET outside=outside +'1' WHERE ad_id='$adse'"; $resultex = mysql_query($sqlex); } } $checkad = mysql_query("SELECT * FROM ads WHERE ad_id='$adse'"); $ad_exist = mysql_num_rows($checkad); if ($ad_exist<1) { echo "You can only click an ad once every 24 hours."; exit(); } $ad = mysql_fetch_array($checkad); ?> <html> <head> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="-1"> <title><?=$config["title"]?></title> <script> <?php if ($r["account"]=="premium") { ?> var x = <?=$config['pro_click'] + 1; ?>; <?php } else { ?> var x = <?=$config['free_click'] + 1; ?>; <?php } ?> var y = 1; function startClock() { if (x !== 'Done') { x = x-y; document.frm.clock.value = x; setTimeout("startClock()", 1000); } if (x == 0) { x = 'Done'; document.frm.clock.value = x; var code = "<?php if($loggedin==1) { $site_code = md5(time().sha1(microtime())); } else { $site_code = "Not Login"; } $_SESSION["adcode"] = $site_code; print($site_code); ?>"; var ad= "<?=$_GET['ad']?>"; success.location.href="success.php?ad="+ad+"&code="+code+"&verify=1"; } } </script> </head> <body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" onLoad="startClock()"> <form name="frm"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td class="maintopright" style=" background:url(images/adloading.gif) no-repeat 150px;border-bottom: 2px solid rgb(51, 51, 51); font-family: Verdana; font-size: 13px;" width="50%"> <div class="maintopright"> <img src="images/top_small.jpg" align="middle" /> <input name="clock" size="3" readonly="readonly" style="border: medium none ; padding: 0pt; font-size: 25pt; font-family: Verdana; vertical-align: top;" type="text"> <iframe name="success" src="view.php?example" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" style="vertical-align: top;" frameborder="0" height="48" scrolling="no" width="48"></iframe> </div> </td> <td style="border-bottom: 2px solid rgb(51, 51, 51); font-family: Verdana; font-size: 13px; " align="left" valign="middle" width="50%"> <strong>Please take the time to visit the sponsor below.<br> Show your website below for only <a href="index.php?option=advertise" target="_blank">$<?=$rowz1["price"]?></a> per 100 views!</strong> </td> </tr> </tbody> </table> <iframe src="<?=$ad["ad_url"]?>" border="0" framspacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> </form> </body> </html> Hey Guys. I am using php to output to frames. When I add an "\n" tag of even a PHP_EOL the second frame shows blank. The weird thing is when I view the page source I can clearly see the HTML of both frames... Can anyone help me resolve this issue? Thanks!
$iframe = "<iframe src='menu_new.php' width='65%' name='menu' id='menu' title='Menu Frame' ></iframe>\n"; //iframe not working when adding the /n on this line $iframe .= "<iframe src='menu-items.php' width='35%' name='menu-items' id='menu-items' scrolling='yes' noresize='noresize' title='Menu Items Frame'></iframe>\n"; echo $iframe; Hai i am very much new to PHP...can any one suggest me.....which framework to follow.....
Thanks & Regards
Shankaar
Hi Guys, Yet again, I was wondering if one of you genious's could help me. I want to be able to take a screenshot of an entire webpage (From the header to footer) using a PHP script. So If I crawled the webpage URL = http://www.google.co.uk/search?q=php+sc ... =en&num=10 I would like to take a screenshot of that entire page from the GOOGLE header to the GOOGLE footer and store it into a TEMPORARY folder on my server and then be able to call it back. Is this possible? I've been searching everywhere for a solution to this but the closest thing I came to was http://mistonline.in/wp/get-youtube-vid ... avascript/ I would be really grateful if one of you could please help me, thank you in advance. M Hello im using mybb forum, and i have another webpage what i want to access with forum username and password. Dont know how to make it work.
Hi, I want to save an webpage into my server location, as simple as that. At present, I am reading the content of the file using curl, save that content into a text file, then save that text file. I assume there must be some straightforward way just to save www.example.com/file.html into my server directory as file.html. Can anyone help me on this, please? Thanks, -Abd I've used get_file_contents() before but it seems like it took a long time to load... what is the best or most efficient way to get certain content from a webpage? Like all the posts on a single forum page for example, without loading any images or styles, just the "source" Just need a correction on this please, there is a Parse error, think I got the quote marks wrong somewhere? echo "<li>" . <a href="/stock/$stock.htm"> .$Stock . ": " . $Name . "</a></li>\n"; Thanks is there some way of checking the pagename in php? for example, home.php also on a side question does anyone know how to autoplay a .avi video without showing anything but the actual video.. (im meaning i dont want to see the progress bar or play, stop, pause buttons etc) all help would be great. I have a particular PHP file which is publicly located, however, I don't want anyone but me to access. Below are my thoughts how to do so. Please comment.
Use an uncommon name, and definitely not index.php.
Either include a file called index.html in the same directory, or set up Apache not to show them using Options -Indexes, or maybe both for good measure.
Require some variable to be set to a given value in either the GET or POST array, and if not set, throw a 404 header and display the 404 missing file HTML. Hey all, What's the most efficient way to wait until a page on your own website is done being rendered, and then parse it for something specific? The reason I'm having to scrape it rather than just generate it myself is because the part being scraped if being generated in an iframe on my site via another site, and the data inside of it is dynamic. Thanks Hey agen i have problem i need info from other webpage Code: [Select] <?php // get as ? $url=$_GET['url']; // value of script $website = $url; $referer = 'olar.eu'; $useragent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; $filename = basename($url); // connect $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_USERAGENT,$useragent); curl_setopt($curl_handle,CURLOPT_AUTOREFERER,$referer); curl_setopt($curl_handle,CURLOPT_URL,$website); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $source = curl_exec ($curl_handle); curl_close ($curl_handle); $a=preg_match("/>Level:.*.\n.*.>([0-9]*)</",$source,$b); $Level = $b[1]; echo "Level: $Level"; ?>i get only empty value url=http://www.gamersfirst.com/warrock/?q=Player&nickname=admin-b13r |