|
How to insert codes in a php file?
|
Post Bank
Posting Manager
     
Posts: 995
Group: Forum Team
Joined: Sep 2006
Status: Online
|
Make money from now. You can make money just for posting on this forum. Every discussions on this community gives you more money. $2 minimum payout. So get your payment today, SignIn with this forum.
Signin to Remove this Post
|
|
|
|
Cedik
Moderator
    
Posts: 424
Group: Moderators
Joined: Aug 2007
Status:
Away
Reputation: 2
Points: 575 (Donate)
|
|
| 02-11-2007 07:49 AM |
|
|
ivenms
Administrator
      
Posts: 2,179
Group: Administrators
Joined: Sep 2006
Status:
Offline
Reputation: 14
Points: 4389 (Donate)
|
RE: How to insert codes in a php file?
A friend of mine inserted banners and google ads directly in the php files so he managed to place google ads in very unusual places.
I tried to do that too but it gave me some errors.
How exactly do you do it?
Is there some trick that I don't know?
Am not clear about your question. But am giving some general tips about .php and HTML with the files.
The execution of a php files done in part by parts. Those parts of a php file enclosed under <?php .... ?> is going to execute. So you can put the normal HTML codes on the .php files with out restriction outside the php code.
Read: General Rules & Policies before posting.
Make Money By Posting | Earning and Exchanging Points | Add Your Links
|
|
| 02-11-2007 07:53 AM |
|
|
Cedik
Moderator
    
Posts: 424
Group: Moderators
Joined: Aug 2007
Status:
Away
Reputation: 2
Points: 575 (Donate)
|
|
| 04-11-2007 12:57 AM |
|
|
ivenms
Administrator
      
Posts: 2,179
Group: Administrators
Joined: Sep 2006
Status:
Offline
Reputation: 14
Points: 4389 (Donate)
|
Outside PHP Tags - How tags are interpreted by PHP Parser
So, I'll open, for example, the theme.php file and add the new html or javascript code after the ?> part? or before the <? part ?
But won't this affect the php file?
Yes...
That parts remains as the same html file..
Im going to explain here the processing of a PHP file when clients request it. -
On the invocation of a php file request, the server settings invokes the php parser to fetch that file and interpret the full file line by line. They only compiles those parts enclosed within <? ---- ?> the other parts directly send to the clients with our executing that part. So the client gets the all parts outside <? ..... ?> intact, without any change.
So you can put any thing out side the PHP tags.
Read: General Rules & Policies before posting.
Make Money By Posting | Earning and Exchanging Points | Add Your Links
|
|
| 05-11-2007 04:03 PM |
|
|
Cedik
Moderator
    
Posts: 424
Group: Moderators
Joined: Aug 2007
Status:
Away
Reputation: 2
Points: 575 (Donate)
|
RE: Outside PHP Tags - How tags are interpreted by PHP Parser
Yes...
That parts remains as the same html file..
Im going to explain here the processing of a PHP file when clients request it. -
On the invocation of a php file request, the server settings invokes the php parser to fetch that file and interpret the full file line by line. They only compiles those parts enclosed within <? ---- ?> the other parts directly send to the clients with our executing that part. So the client gets the all parts outside <? ..... ?> intact, without any change.
So you can put any thing out side the PHP tags.
But it didn't work for me. 
I put the code outside the <? part and nothing :|
It was an ad-sense code and no ads appeared on my page...
MyBB.ro|Extra.animezup.com|Picture with me ^^|Animezup.com|Forum.animezup.com|Manga-anime.ro|My blog^^
|
|
| 05-11-2007 08:39 PM |
|
|
shadav
The Forgotten One
     
Posts: 391
Group: Super Moderators
Joined: Oct 2006
Status:
Online
Reputation: 2
Points: 1058 (Donate)
|
RE: How to insert codes in a php file?
create a new file called adsense.php within the file you are wanting it to display try using
<?php include "http://www.yoursite.com/adsense.php"; ?>
or
<?php include "/path/to/your/file/adsense.php"; ?>
For example:
<?php include "/home/shadav/public_html/sidebar.inc"; ?>
₪ Foamy Fanatics Fan Site
Webmasters Resource Forum ₪ Photos For Sale
|
|
| 05-11-2007 11:41 PM |
|
|
Cedik
Moderator
    
Posts: 424
Group: Moderators
Joined: Aug 2007
Status:
Away
Reputation: 2
Points: 575 (Donate)
|
|
| 06-11-2007 04:13 AM |
|
|
ivenms
Administrator
      
Posts: 2,179
Group: Administrators
Joined: Sep 2006
Status:
Offline
Reputation: 14
Points: 4389 (Donate)
|
RE: How to insert codes in a php file?
But it didn't work for me. 
I put the code outside the <? part and nothing :|
It was an ad-sense code and no ads appeared on my page...
Are you using the same code given by adsense?.. Just put the code in the file as HTML code, nothing else. Also don't try to put code with the help of advanced HTML editors like frontpage or dreamviewer. Since we are dealing with page codes, they can generate unwanted codes for the page, which generates errors. Use notepad for coding.
Well, I understood that but now comes the though part...
How do I create a php adsense file? 
Does google adsense generate a php code too, not just a html one?
Very simple..
Open your notepad. Name the file as "adsense.php".
Then put the adsense code int the file as content and save it. Then upload it into your site. Very simple. That is not though and it is the simplest part. The main advantage of using a separate file for ads is that you can change the entire site's ads by changing a simple file.
Read: General Rules & Policies before posting.
Make Money By Posting | Earning and Exchanging Points | Add Your Links
|
|
| 06-11-2007 04:49 AM |
|
|