Home Forums Register FAQ Members List Calendar Search Today's Posts Mark Forums Read Arcade Chat
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP
Reload this Page [TUT] How to edit sites html (Others CANNOT see)
PHP Discussion of PHP scripts belongs here.

[TUT] How to edit sites html (Others CANNOT see)

Reply
 
LinkBack Thread Tools Display Modes
[TUT] How to edit sites html (Others CANNOT see)
Old
  (#1)
Billybob1234 is Offline
Super Moderator
Billybob1234 is a glorious beacon of light
 
Billybob1234's Avatar
 
Posts: 2,651
Join Date: Jan 2008
Location: Wisconsin
Age: 19
Rep Power: 25
  Send a message via AIM to Billybob1234 Send a message via MSN to Billybob1234 Send a message via Yahoo to Billybob1234 Send a message via Skype™ to Billybob1234 
Default [TUT] How to edit sites html (Others CANNOT see) - Monday, August 31st, 2009

What I am going to show you is how to edit pages you don't own's HTML.

E.g:
If the background color is blue; the HTML will probably be:
Code:
<body bgcolor = 'blue'>
What this TUT will do is show you how to change something like that to make the background of the site, lets say, purple.

You must either have localhost, (I suggest XXAMP or Wamp for this (I use wamp)) or a website.

Step 1: You must open the webpage as a file:
Code:
<?php

$file = "SITE HERE";
$page = file($file);

?>
Step 2: $page is an array. So, you can't start editing yet. You will have to use the "foreach()" function:
Code:
foreach($page as $part) {

}
Step 3: Now, we can start editing the page. You will have to use the ereg_repalce() function to do so. ereg_replace is somewhat like str_replace.

Okay, lets say a sites html is:
Code:
<html>
<body bgcolor = 'blue'>

<h1>Welcome to this Site!</h1>
To make that page's background purple, and the message say "GET OUT!" you must use this script:
Code:
<?php

$file = "SITE HERE";
$page = file($file);

foreach($page as $part) {
$part = ereg_replace("<body bgcolor = 'blue'>", "<body bgcolor = 'purple'>", $part);
$part = ereg_replace("<h1>Welcome to this Site!</h1>", "<h1>GET OUT!</h1>", $part);

echo $part;
}
Okay, that will make the page's bg purple, and the welcome message say "GET OUT!". The parameters of ereg_replace() are:

ereg_replace(Original html, what to replace original html with, where to replace this info);

To get the html of a site, go to it, right click > View page source.

This is pretty much useless, but fun to mess around with. Hope you enjoy, if you have any problems tell me.


http://img196.imageshack.us/img196/769/sig2i.png
  
Reply With Quote
Old
  (#2)
Stardude0419 is Offline
Administrator
Stardude0419 is on a distinguished road
 
Stardude0419's Avatar
 
Posts: 3,436
Join Date: Nov 2007
Location: jupiter
Age: 12
Rep Power: 10
  Send a message via AIM to Stardude0419 Send a message via Yahoo to Stardude0419 Send a message via Skype™ to Stardude0419 
Default Monday, August 31st, 2009

I did that once to Adam's site. It's fun in a weird and pointless way though I did it in the...in the....what's it called....the thing you would use to run PCL. Something with a ++ in it I think. Nice tut by the way.



Still alive....in a way....
  
Reply With Quote
Old
  (#3)
wweice is Offline
Senior Member
wweice
 
wweice's Avatar
 
Posts: 877
Join Date: Feb 2009
Age: 12
Rep Power: 0
  Send a message via AIM to wweice Send a message via MSN to wweice Send a message via Yahoo to wweice  
Default Tuesday, September 1st, 2009

Quote:
Originally Posted by Billybob1234 View Post
[/code]To make that page's background purple, and the message say "GET OUT!" you must use this script:
[code]<?php

$file = "SITE HERE";
$page = file($file);

foreach($page as $part) {
$part = ereg_replace("<body bgcolor = 'blue'>", "<body bgcolor = 'purple'>", $part);
$part = ereg_replace("<h1>Welcome to this Site!</h1>", "<h1>GET OUT!</h1>", $part);
Or you could just copy all the html, paste it into notepad, find
<body bgcolor = 'blue'>

<h1>Welcome to this Site!</h1>
and replace it with.
<body bgcolor = 'purple'>

<h1>GET OUT!</h1>
then save it as a .html file then open it.


Steven: May the Lord be with you.

  
Reply With Quote
Old
  (#4)
pingboy10 is Offline
Member
pingboy10 is an unknown quantity at this point
 
pingboy10's Avatar
 
Posts: 385
Join Date: Aug 2008
Location: NY Queens.
Age: 13
Rep Power: 0
  Send a message via AIM to pingboy10 Send a message via MSN to pingboy10 Send a message via Yahoo to pingboy10 Send a message via Skype™ to pingboy10 
Default Thursday, September 3rd, 2009

Tsk, that kinda crap is hard, but wow. I thought HTML had to be customed made for a site in order to edit one.


C:\Users\user\Pictures\Pings things\Chrome Pingboy.png http://up.mibbit.com/up/s0UuGnJn.wav
Death wish is coming by minute by minute.
  
Reply With Quote
Old
  (#5)
Northyy is Offline
Senior Member
Northyy is an unknown quantity at this point
 
Northyy's Avatar
 
Posts: 887
Join Date: Nov 2008
Rep Power: 0
   
Default Saturday, September 5th, 2009

Quote:
Originally Posted by Stardude0419 View Post
I did that once to Adam's site. It's fun in a weird and pointless way though I did it in the...in the....what's it called....the thing you would use to run PCL. Something with a ++ in it I think. Nice tut by the way.
CLI? (10 character rule )


http://img194.imageshack.us/img194/1328/cruisecontrol.png
http://images.wikia.com/openserving/...Chris_paul.jpg
ninjarocker123guy: i dont get it; NorthyyCP3: /facepalm; ninjarocker123guy: whats that?; NorthyyCP3: http://cdn0.knowyourmeme.com/i/1582/...d-facepalm.jpg ; ninjarocker123guy: i dont get it its just a guy tell me dude; NorthyyCP3: /double facepalm;
  
Reply With Quote
Old
  (#6)
Billybob1234 is Offline
Super Moderator
Billybob1234 is a glorious beacon of light
 
Billybob1234's Avatar
 
Posts: 2,651
Join Date: Jan 2008
Location: Wisconsin
Age: 19
Rep Power: 25
  Send a message via AIM to Billybob1234 Send a message via MSN to Billybob1234 Send a message via Yahoo to Billybob1234 Send a message via Skype™ to Billybob1234 
Default Sunday, September 6th, 2009

Quote:
Originally Posted by wweice View Post
Or you could just copy all the html, paste it into notepad, find
<body bgcolor = 'blue'>

<h1>Welcome to this Site!</h1>
and replace it with.
<body bgcolor = 'purple'>

<h1>GET OUT!</h1>
then save it as a .html file then open it.
That will only load the html, not the CSS, php, and all that stuff, this will load everything.


http://img196.imageshack.us/img196/769/sig2i.png
  
Reply With Quote
Reply

Lower Navigation
Go Back   ClubPenguinHQ Forums > General Discussion > Programming > PHP

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of File Hosting sites (download sites) Friend 001 Hacking/Programming 31 Thursday, August 28th, 2008 03:32pm
Unblock Sites/ Get around Unblocking Software. The Test General Chat 10 Saturday, June 14th, 2008 11:09pm
Sites like Piczo and Yahoo! Geocities? Master MRZ General Chat 3 Wednesday, May 21st, 2008 04:00am
Do you think sites made in 2005 are successful? iJohn General Chat 3 Sunday, December 30th, 2007 08:41pm



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Skin developed by: vBStyles.com
Copyright ©2006 - 2009, RancidKraut Industries