Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   adding adsense to cgi (https://www.warriorforum.com/programming/888686-adding-adsense-cgi.html)

paulgl 8th January 2014 12:08 PM

adding adsense to cgi
 
I installed a cgi script, in perl I believe. Never having done that,
I am clueless. Anyway, I thought I could just find the html code
inside it and add anything, like adsense. When I do that, I
get an internal server error. Obviously, adding an outside script
must require some special notation or something. Either that, or
it's impossible without an error. Do I need to use "\" in parts?

Yes, I have googled it and keep getting pages not related to what
I want.

Any help would be appreciated.

Paul

GamerZag 9th January 2014 01:03 PM

Re: adding adsense to cgi
 
It is pretty easy. Put your extra stuff in a file and then do what this link says: print - perldoc.perl.org

ASUService 9th January 2014 01:47 PM

Re: adding adsense to cgi
 
As GamerZag mentioned you can use the print command. Combining an external file via the print command is a good way too. Here's how ...

Perl include file dynamically - Stack Overflow

Yes you'll need to escape some of the html to get it to place nice with perl. IE:

See this page ... http://www.perlmonks.org/?node_id=401006

Scroll down to "escape characters"

There's more possible clashes but this is the only one you mention specifically.

Have you thought about flipping to PHP ... Perl is almost dead so hate to see you put a lot of work into it. With php you can simple use "include" and have the code in a separate file. PHP will also require escaping if you wish to have it hardcoded.


All times are GMT -6. The time now is 09:13 AM.