PHP - Embedding Webpages, Iframe Alternative?
Hello.
I've asked around in many places now, and I thought I'd ask here too. A few days ago I installed phpBB3 on my site, works like a charm. I used a plugin for wordpress to integrate phpbb to wordpress, all works great. Now my problem is to embed the forum to my wordblog page. I tried using a simple iFrame solution, and it worked almost, but there's a common iFrame problem. The height, it doesn't scale with the embedded page, instead it stays as a 100px high frame with a scroll bar. I've searched google for hours now, and tried every possible javascript and css/div-tag solution I came across. Nothing works. Are there any alternatives to this? I tried using <?php include('../phpBB3/index.php') ?> But I get errors. It might be because I'm including from another directory, so it might be worth giving a try to give the direct path somehow, but how? Anyway, are there any other solutions for this problem? Similar TutorialsHi. 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 Ok, I would just like some advice on how to go about doing something. A website that alot of my friends use to make their builds in-game goes down frequently causing them not to be able to pull up their build information. I would like to be able to use php to copy not only the html source, but the images as well to my websvr to be able to view when their site is offline. Now I know I could simply just click page -> save as complete html in internet explorer and then upload that... However I don't want to have to do that for everyone stuff.. its time consuming.. I was hoping to automate the process with a script. I know how to get the html source from a website, but I don't know how to pull the content "pictures ect." to make it actually look like their site and have more than just text. I'll appreciate any advice you can give, I think some simple direction should be enough to get me going. I've finished designing my website home page and I've now moved on the some of the other pages, I want my header and footer to appear the same on every page. I've tried this basic way of linking the same stylesheet that makes up my header/footer in the second HTML file (already used in the homepage):
<link rel="stylesheet" href="footer.css" type="text/css"/> <link rel="stylesheet" href="header.css" type="text/css"/> I now understand that this isn't going to work. Would a server-side scripting language be my best bet here? Something like PHP? If so, would anyone be able to link me with an article on how I could do this in PHP, I presume with the include function? I've had answers elsewhere but this, for me, isn't working: "You are currently only linking the css for the header and footer. If you want to include the html as the same, create two separate files header.php and footer.php, then include them into each webpage. <?php include('path/to/header.php');?> // in the location you want the header in the page <?php include('path/to/footer.php');?> // in the location you want the footer Essentially, you're making partials and placing them wherever you want them" Any help would be greatly appreciated. Edited by Coplestone, 15 January 2015 - 11:52 AM. Hi, Where to install this PHPMailer? It is on WebServer or it will work if I install it in the same folders where my webpages are? Thanks. I'm trying to work on my php skills by creating an online content "finder". I'm using cURL to grab webpage HTML and store it in a variable. I then want my program to find the article title, keywords and the content. I'm using articles from Ezine. here is an example webpage. Code: [Select] http://ezinearticles.com/?8-Ways-to-Reduce-Stock-Investment-Risks&id=954266 I don't have any problems grabbing the webpage html. But when I try to grab the title, keywords, and content using this code. Code: [Select] $title = getbetween($html, "<title>", "</title>"); $keywords = getbetween($html, "<meta name=\"keywords\" content=\"", "\">"); $content = getbetween($html, "<div id=\"body\">", "</div>"); $content = "<P>" . getbetween($content . "<E>", "<P>", "<E>"); echo "Title: " . $title . "<P>"; echo "Keywords: " . $keywords . "<P>"; echo "Content: " . $content . "<P>"; Only the title comes out of the page, the rest of the values are blank... I'm not sure why the getbetween is only working to extract the title from the html. Does anyone have any ideas why?? I tried testing to see if it was grabbing the propper webpage and when I used 'echo $html;' the webpage came out fine on my page.. I am totally lost on this, I just want to practice using cURL and my webrequest coding. Thanks for any help, I appreciate it. I'm trying to Embed the images from Apple into my PHP file. Code: [Select] $phpobj = unserialize($response); if (is_array($phpobj)) { foreach ($phpobj['value']['items'] AS $key => $val) { printf("<div><p><a href=%s>%s</a></p><p>%s</p>\n", $val['link'], $val['title'], $val['description']); } } But the problem is that the image attribute is inside a Table and using something lile $val['img'] is not working. So anybody can help me with this. Here is the RSS feed format from which I'm importing Code: [Select] <item> <title>Dead Awake - Trailer</title> <link>http://trailers.apple.com/trailers/independent/deadawake/</link> <description>DEAD AWAKE is a seductive supernatural thriller starring Rose McGowan, Amy Smart and Nick Stahl set against the backdrop of a mysterious tragedy that shattered their lives a decade ago and which sets them on a path to uncover the truth that lies between the living and the dead.</description> <pubDate>Wed, 01 Dec 2010 00:00:00 PST</pubDate> <content:encoded><![CDATA[ <table> <tr valign="top"> <td width="67"><a href="http://trailers.apple.com/trailers/independent/deadawake/"><img src="http://trailers.apple.com/trailers/independent/deadawake/images/poster.jpg" width="65" height="97" border="0"></a></td> <td> </td> <td><a href="http://trailers.apple.com/trailers/independent/deadawake/"><span style="font-size: 16px; font-weight: 900; text-decoration: underline;">Dead Awake - Trailer</span></a><br /> <span style="font-size: 12px;">DEAD AWAKE is a seductive supernatural thriller starring Rose McGowan, Amy Smart and Nick Stahl set against the backdrop of a mysterious tragedy that shattered their lives a decade ago and which sets them on a path to uncover the truth that lies between the living and the dead.<br /><b>Directed by:</b> Omar Naim<br /><b>Starring:</b> Nick Stahl, Rose McGowan, Amy Smart, Ben Marten, Kim Grimaldi, Brian Lynner, Justin Marxen, James Serpento, Jack Mishler, Shane Simmons, Rachel Storey, Justin Urich, Andrea Leon, Livia Milano, Phyllis Mumford</span></td> </tr> </table> ]]></content:encoded> </item> i want to change the content of my div tag dynamically using javascript in PHP. I am using the following technqiue but it is not working. <?php echo "<script type='text/javascript'>\n"; echo "document.getElementById('mydiv').innerHTML = 'contents of div.......';"; echo "</script>"; ?> please guide me how can i do this Thanks, Best Regards, Nice Candy. HI I am trying to find solutions on how i am able to embed IP Screenshots into a website. Right now i am able to do so but only if i am connected to a certain internet network, then i would be able to see those IP Screenshots images. However if i am not connected to that network, the website are not able to show them. THANKS ALOT!! So the server that host my website is not accepting .php files at the moment. I have a form mail in .php format, can anyone recommend an alternative form mail that will not use .php extension? Thank you kindly Hi i learnt today hard way that die(); can kill of loading the rest of your html page if you place it in the middle of your html after a few hours of trying to work out what was wrong and wondered what alternatives there are i have tried a few like "E_USER_ERROR" and "trigger_error" but none halt the script and display a message or do it without loading the rest of my page, There must be another way i just havent found it and would be really grateful if someone could tell me it. Thanks, Blink359 OK, I've seen this done both ways and want to know which (if any) is the most secure way to do it... I've been coding my pages using echo statements to write HTML, such as: <?php echo "<p><strong>hello, World!</strong></p>"; echo "<p>You a $age year(s) old!</p> "; ... ?> and so on... but is this any better <?php <p><strong>Hello World!</strong></p> echo "<p><strong>You are $age year(s) old!</p>"; ?> Is one of these methods better than the other (using ECHO to write actual HTML statements out rather than just embedding them in the script without ECHO)? Which is the recommended method? I want a free alternative to 000webhost. I don't want to use something like xampp because eugh I don't get on with it. Thanks I need to use something else than cURL to create the code to login to myspace accounts, I have to be able to enter postfields, Thanks I am validating a registration form. If there is an error on the form it adds 1 onto the variable 'iserror'. The form will only submit if there are 0 errors. However, I have a function within this function that checks the database to see if the username is available or taken. When 1 is added to the variable within that function it doesn't work. After researching it a bit I have come to the conclusion it is not possible to use the variable within another function. So what could I do to validate this function as well?
Thanks
function buttonFunction(){ var iserror = 0; v=$("#txtusername"); $.post('../action/checkusername.php',{user:v.val().toLowerCase()},function(d){ if(d=='available'){ $("#usernamemessage").html("<span style='color:green;'>Username is available</span>"); }else if(d=='not-available'){ $("#usernamemessage").html("<span style='color:red;'>Username is not available</span>"); iserror = iserror + 1; } }); if(document.getElementById('selaccounttype').value == "AccountType") { $("#accounttypemessage").html("<span style='color:red;'>Select Account Type</span>"); iserror = iserror + 1; } else { $("#accounttypemessage").html("<span></span>"); } Edited by slj90, 18 August 2014 - 12:46 PM. So to stop third-party traffic on certain media files my site does, I did a download.php type script that just took in the media id, and found the filename and did a readfile on it for the user. The problem is that when you start doing massive amounts of traffic with it, I think the readfile stream is taking up a lot of cpu. Is there any alternative to readfile that creates a direct link between the user and the file, instead of it having to go through the php? I'm afraid that this is something I need to do on the server end, and not in PHP, but I figured I'd ask. Hey guys. I currently have my website set up 'generating' php pages, rather than simply getting data off the database. Which is silly. I have no rectified that issue but end up with ugly urls such as http://www.worldwidelighthouses.com/Lighthouses/English-Lighthouses/Trinity-House-Owned/Lighthouse.php?Lighthouses=Beachy-Head Whats the best way to translate that into http://www.worldwidelighthouses.com/Lighthouses/English-Lighthouses/Trinity-House-Owned/Beachy-Head Im hopeless with apaches mod_rewrite... Many many thanks in advance. Danny i need to read a pdf and convert it to raw text (with line breaks - but that's as fancy as i need it)... pdflib does way more than i need, and it's super expensive, and i don't really see the need to install an app on my server just to read a simple pdf... there must be an alternative out there, but i can't seem to find it... and when all of php.net seems to reference pdflib, i start to get a little discouraged... it seems like a simple pdf reader class/package would be open source somewhere... any suggestions? thanks Hi Everyone Does anybody know if there an alternative to preg_match? I cant get my head round regex so im having difficulty setting different preg matches. Is there an easier alternative? Thanks I want to encode a long string, and wish to make it shorter. base64_encode is very handy but it makes the string length longer. Is there an alternative to do the encoding/decoding with shorter encoded string length? I have four check boxes that will determine how a search is conducted and I have retrieved the data through _POST[] The problem I have is how can I act upon the data returned? Each of the four text boxes could independently start a search but if I use an If statement the first choice will block the rest of the options eg. Code: [Select] if ($clientValue == "on"){ echo "perform a search based on above"; } |