antonyfal Posted July 18, 2011 Share Posted July 18, 2011 Hi, Maybe ii asked it in the wrong way--- i have a webpage html format index.html with an iframe name ="mainframe" is there a way to have a url/link open another url webpage in the mainframe on the index.html page? example url to open: something like.. http://www.xxxxxxxxxx.com/thisurl/in this iframe/on this page/....... //thisurl= the url to open in the frame and is on the same server as the iframe index.html page //in this frame= the frames name //on this page will be the index.html page I have no clue, and if it is possible? would i have to specify the iframes styling too? this is quite urgent if anyone can give an example/explanation would be much appreciated.. regards Tony Quote Link to comment Share on other sites More sharing options...
requinix Posted July 18, 2011 Share Posted July 18, 2011 Not sure if I get the question, but Quote Link to comment Share on other sites More sharing options...
antonyfal Posted July 18, 2011 Author Share Posted July 18, 2011 Hi thanks for this, What if i don't know the url? like for example in my site a user can share their profile with EG: facebook friends.. a link/url is passed to the facebook wall to be shared.. When that link is pressed, it must then open the profile owners page within an iframe "mainframe" on the index.html page.. // the links will always be different.. Is there a way to do this? on a html page? Quote Link to comment Share on other sites More sharing options...
requinix Posted July 18, 2011 Share Posted July 18, 2011 If you can control the link they're posting then you can do whatever you want... Quote Link to comment Share on other sites More sharing options...
antonyfal Posted July 19, 2011 Author Share Posted July 19, 2011 Hi requinix Can you show me an example? or a way to go about it, or where to find an example.. If i can sort this out i can launch my mobile site:D.. I understand the control i have over the link.. just how to get it to open in the index.html iframe "mainframe".. i would think it should be a simple solution, but all the examples i have found are slightly off what i need and cant be customized.. what should the URL look like!? if i know that at least then i can figure it out (maybe)... It must be a share type link to the profiles page, which will open on the index.html page in the Iframe.. Regards and thanks for the effort this far.. Tony Quote Link to comment Share on other sites More sharing options...
requinix Posted July 19, 2011 Share Posted July 19, 2011 I gave you an example for how to stick a URL into your "mainframe". The URL people post can be anything you want; examples are /profile/foo /profile.php?username=foo /#!/foo /share.php?123qweasdzxc Depending on the URL you might have to look up additional information (like what profile "123qweasdzxc" corresponds to) but otherwise it's fairly straightforward. PHP scripts are always "customizable". If there's something close then it might be easier for you to just edit that. Quote Link to comment Share on other sites More sharing options...
antonyfal Posted July 19, 2011 Author Share Posted July 19, 2011 i see what you getting at!! but i need a proper example: my site user will send/share the link below via email. the link on its own opens in a webpage on its own at the moment.., but there is plenty of things on that page i dont want to include with the share link.. // demo is the profile owners name, and 1 is the profile uid.. This url can be in a email attachment, or on a facebook wall or wherever.. https://www.xxxxxxxx.com/models/viewprofile/demo/1.html // i need this url to open/target in the mainframe located on the index.html page, I don't want the url to open on its own page.. How can i do that with the example you gave me? please if you or anyone knows this is quite important and my last step to complete my site.. Best regards Tony Quote Link to comment Share on other sites More sharing options...
requinix Posted July 19, 2011 Share Posted July 19, 2011 Then what you can do is use URL rewriting to turn https://www.xxxxxxxx.com/models/viewprofile/demo/1.html into something like https://www.xxxxxxxx.com/index.html?viewprofile=1 That page then does $mainframe = "http://www.xxxxxxxxxx.com/thisurl/in this iframe/on this page/......."; // default if (!empty($_GET["viewprofile"]) && ctype_digit($_GET["viewprofile"])) { $mainframe = "https://www.xxxxxxxx.com/models/viewprofile/-/" . $_GET["viewprofile"] . ".html"; }?> (I turned the /demo/ into /-/ since it won't matter... unless it does matter to your stuff, in which case you (a) pass the name in the rewritten URL or better (b) look up the name in index.html according to the ID.) Quote Link to comment Share on other sites More sharing options...
antonyfal Posted July 19, 2011 Author Share Posted July 19, 2011 Ok, im grasping it-- Im getting a clue.. So i can have multiple "?" in the url one for models, one for name(demo), one for uid(1) or will the 1 already be included in the viewprofile? as per example.. So all i basically have to do i think is just make the url like your example--- i neednt do the whole .htaccess thing.. I just have to change the url to shift and have the options "?" in it.. its easy... then the html will pickit up in the index.html page.. I think i get it now.. I may have a small trial and error problem comming my way adding the extra "name" and "models" to the html you gave me... But im sure i can look it up somewhere.. When i get it working or if i have further issues ill post it.. Thanks a stack.. Tony Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.