PHP - Moved: How To Contract The Content Of An Embeded Webpage
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=319610.0 Similar TutorialsI'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" This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=309827.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=321950.0 This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=316401.0 Hi all,
Looking for grad/junior back-end PHP developers based in Preston for a number on contract openings. Not looking to pay more than £220pd. Please send across your up to CV to s.parry@parity.net or call now on 0845 872 4081.
Thanks everyone
Hello everyone I am working on a blog system. and I am having problems with the youtube video embed I have found some script online that kinda works If I post more then one youtube link the player shows up.. but it says movie not loaded. if I post just one video it just shows the url to the video on youtube. here is my youtube_function.php <?PHP //convert youtube links into embede function show_youtube($text) { $VID_WID = 320; $VID_HEI = 240; for ($k=0; $k<9; $k++) { $text .= ""; $find = 'youtube.com/watch?v='; $pos = strpos($text, $find); if ($pos == false) { break; } $len = strlen($text); for ($i=$pos; $i>=0; $i--) { if (substr($text, $i, 6) == 'http://') { $pos1 = $i; break; } } for ($i=$pos; $i<$len; $i++) { if (in_array($text[$i], array('&', ' ', "\r", "\n", ',', "\t"))) { $pos2 = $i; break; } } $link1 = substr($text, $pos1, $pos2 - $pos1); $link2 = str_replace('/watch?v=', '/v/', $link1); $embed = '<object width="' . $VID_WID . '" height="' . $VID_HEI . '">'. '<param name="movie" value="' . $link2 . '"></param>'. '<param name="allowFullScreen" value="true"></param>'. '<param name="allowscriptaccess" value="always"></param>'. '<embed src="' . $link2 . '" type="application/x-shockwave-flash" '. 'allowscriptaccess="always" allowfullscreen="true" '. 'width="' . $VID_WID . '" height="' . $VID_HEI . '"></embed></object>'; $text = str_replace($link1, $embed, $text); } return $text; } ?> and I have index.php <?php session_start(); include ("includes/includes.php"); include ("includes/youtube_function.php"); ?> <!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" xml:lang="en" lang="en"> <head> <link rel="stylesheet" href="includes/style.css" type="text/css" media="screen" title="no title" charset="utf-8"> <title>Simple Blogging System</title> </head> <body> <div id="wrap"> <div id="header"><h1>Simple Blogging System<br /><font size="6">*Keep it simple*</font></h1></div> <div id="nav"> <center> Link Link Link </center> </div> <div id="main"> <div id="blogPosts"> <?php $blogPosts = GetBlogPosts(); foreach ($blogPosts as $post) { echo "<div class='post'>"; echo "<h2>" . $post->title . "</h2>"; echo show_youtube($post->post, $text); echo "<span class='footer'>Posted By: " . $post->author . " Posted On: " . $post->datePosted . " Tags: " . $post->tags . "</span>"; echo "</div>"; ?> <br /> <?php } ?> </div> </div> <div id="sidebar"> <h2>Archive</h2> <p> old </p> <p> old </p> <p> old </p> </div> <div id="footer"> <p>Simple Blogging System</p> </div> </div> </body> </html> so as you can see I have show_youtube($post->post, $text); I have tried this just out of curiosity to see if I could fix this myself. but It seems like the video does not want to run at all... I am confused with this and some help would be greatly appreciated. Thank you in advance This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319085.0 Stop posting non-PHP questions in the PHP Coding Help section. We have many sub-forums, including both a JavaScript forum and one dedicated entirely to Ajax. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=327454.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=357949.0 This topic has been moved to Website Critique. http://www.phpfreaks.com/forums/index.php?topic=346717.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=315351.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319719.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=314750.0 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(); } ?>
This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=318539.0 Hi, I will start off trying to explain what I am trying to make the best I can. What I want to create is a script that gets the gold value from this website: http://www.lbma.org.uk/pages/index.cfm?page_id=46&title=current_statistics and then save it to a variable which I will use to calculate values of different gold karats. Here is the content in bold I need on the website I linked: Quote LONDON GOLD FIXING USD GBP EUR AM 1588.00 1005.127 1251.083 PM 1589.50 1004.741 1249.803 So what help do I need? Well, I don't expect you to figure out the calculating part for me but some help how to get that content pointed out above and save it to a variable is what I would appreciate getting some help with. I don't know much PHP, only some and I have been trying to figure this out for a day now without any success. I suppose php get contents and/or curl should be used here but I don't know how really. I would very much appreciate the help I can get on this. Thank you! 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 So we just started php after learning a month of HTML, and we need to create a website with a page that allows the admin to change the colors and font size, header, etc on the webpage itself via forms. E.g. I'm on the site and I can use a drop down menu to change the background to "blue" for example. No need to go edit the CSS file or anything. How can be this done? My second and final question is how would I write code that allows my website to have users "log in" to their account so they can edit their page? Thanks a lot, I'm not good at PHP yet I've just started so please keep that in mind:) - Kranti Hi All... I am looking for a way of saving currently open webpage as a pdf file.........I searched for that and even gone for this site http://www.tcpdf.org. But there also I didn't find any perfect way of doing this all....If somebody else has tried tcpdf for that or done something like that, then plzzzzz plzzz plzzzz do help me....Thanx...... 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 |