Log in

View Full Version : Requesting HTTP access



raen1
11-30-2007, 11:16 PM
I want to be able to easily fetch a web page, and work with it in my html. However, the pages I'm thinking of produce a different output in my browser's View -> Source command than they do in notepad. The page is generated by the page's code. So, how could I retrieve the generated code, rather than the actual code?

Eternal_Howl
12-01-2007, 12:40 AM
You want to be able to easily fetch a web page and work with it in your html - do you mean your html developing program? Or are you wanting to view someone else's source code and modify it to suit your own needs?

raen1
12-01-2007, 01:56 AM
Well I'm trying to develop a mod for a forum where if you are not logged in, you get a little bar at the top asking to register. I want to be able to detect if the user is logged in, and thankfully, the page generated by the forum is different if you are not logged in. So, I figured that divining that source code would be somewhat easier than turning a frame into a string. Although, if I can make a frame, and then get a string from it, that would be fine too.

thetestingsite
12-01-2007, 02:53 AM
Why not just check to see if the session is set (if the user is logged in). If it isn't, then you can modify the output to show that register bar. Without more information about the forum, programming language, etc. there is no real way for us to help you further.

Hope this helps.

boogyman
12-01-2007, 04:28 AM
ajax application.

call page
-- server-side processing
-- return code
place page where needed


all the processing of the page should be done on the server-side like any other of your scripts. if you have a sorta of "forum" where the user needs to login, well then this is definitely something that you need to add at the top of the server-side page. The best would probably be to
<?php include("checkSecurity.php"); ?> on every page so the session can stay enabled and the user will continue to stay logged in if he/she was ever logged in

djr33
12-01-2007, 07:00 AM
You're going about it the wrong way, I think. Build this into the system, rather than making a strange shell around the whole thing. Check the session, refer to the database, etc etc.

BLiZZaRD
12-01-2007, 04:33 PM
If the forum you are looking at already has it (all of them do) download the forum install files, and look at them there, in SMF you would want to look at board.index.php and a few others, phpbb is the same, except you will need the .tpl files to view.

For the Mod, you can just find the if user is not logged parts and add your code to show the registration bar.

raen1
12-01-2007, 05:21 PM
I am in fact using phpbb.. I was planning on building it into the files, but I couldn't find exactly what I was looking for in the documentation as a function. So I guess I will just poke around the php. Thanks all!