Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


php - OB

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Mon Aug 18, 2008 5:22 am    Post subject: php - OB Reply with quote

edit :

I meant when echoing html using php that's all i meant. Sorry for not making this clear.

<?php

ob_start();

echo '<html><head /> <body bgcolor="black" text="gold"><p>At worlds collide</p>';

header('Location: http://www.google.se');
?>

_________________
Intel over amd yes.


Last edited by NINTENDO on Thu Aug 21, 2008 7:13 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
DeviantGeek
Newbie cheater
Reputation: 0

Joined: 30 Apr 2006
Posts: 20
Location: 127.0.0.1

PostPosted: Wed Aug 20, 2008 10:28 am    Post subject: Reply with quote

you cant modify the header, last i checked at least. before you send html it sends the header information to the browser. once its sent, the browser expects whatever was in the header.

i use a template engine i wrote, so this isnt something i ever need to worry bout. no html is sent till the end of my scripts which leaves me the ability to change the header when ever i want.

im not sure what your trying to do or why you would need to do this, but ob_start() is a good idea if your not using templates. no html is sent to the browser then till you spew it out. meaning the header hasnt been sent yet leaving you the ability to change it if you need to.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Aug 20, 2008 2:29 pm    Post subject: Reply with quote

NO it wont work. If you try it will give u header has already been sent error. Cause u already sent the packet to the client so how are u gonna get it back?
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Wed Aug 20, 2008 3:54 pm    Post subject: Reply with quote

As soon as you do echo(), printf() or any other function which prints text (an empty line too afaik) it will set the normal HTML header.
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Thu Aug 21, 2008 12:45 am    Post subject: Reply with quote

if you get a error in php saying

your headers were already sent..

that means.. you used a function to redirect to another page or something.. a html function even with
meta http-equiv=REFRESH or something

anyways that just means you have to run php code first.. then run html after.. but yah u could do html prints in php as long as its printed from php page which is included by another php page.. so php ran first u could echo out the html or print it which ever. This all i remember when i coded in php a few years ago.


just post your code I could help you out

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Aug 21, 2008 6:45 am    Post subject: Reply with quote

I meant when echoing html using php Sad that's all i meant. Sorry for not making this clear.

<?php

ob_start();

echo '<html><head /> <body bgcolor="black" text="gold"><p>At worlds collide</p>';

header('Location: http://www.google.se');
?>

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Thu Aug 21, 2008 1:13 pm    Post subject: Reply with quote

headers location url means redirect to another page..


you get that error cuz u trying to put in HTML.. but you got redirected so

you have to run the headers code first then any echo code after why u try to put in some html.. when its just gets redirected to google anyways u wont see your code.

_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
DeviantGeek
Newbie cheater
Reputation: 0

Joined: 30 Apr 2006
Posts: 20
Location: 127.0.0.1

PostPosted: Thu Aug 21, 2008 7:45 pm    Post subject: Reply with quote

Naablet wrote:
I meant when echoing html using php Sad that's all i meant. Sorry for not making this clear.

<?php

ob_start();

echo '<html><head /> <body bgcolor="black" text="gold"><p>At worlds collide</p>';

header('Location: *omgawd i cant post urls yet!*');
?>


this will work if you want to send them to google. since the output buffer is capturing the html, nothing is sent to the users browser which means the header hasnt gone either. but normally nobody needs to spew out html then do a header(location) because you do all your checking before you start any html lol
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites