Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Generator - I think I've cracked the code!
Old 05-02-2009, 10:09 PM Generator - I think I've cracked the code!
Physicsguy's Avatar
404 - Title not found

Latest Blog Post:
Challenges
Posts: 824
Name: Scott
Location: Ontario
Trades: 0
Haha, funny little pun in the title.

Awhile back, I posted a question on how to make one of those fancy online generators. All I got were PHP answers, or simply "it's impossible". Well, not anymore!

I'm sort of a noob with Javascript, but this has made me really proud of what I made, hopefully it will help all the less-fortunate people who's host doesn't support PHP!

Code:
<script type="text/javascript">

/***********************************************
* Javascript Generator Script by PGReviews (Physicsguy's Reviews)
* Visit http://www.execulink.com/~kayes/physicsguy/web/ for reviews, guitar tablature, and more!
* This notice must stay intact for legal use
***********************************************/

function welcome()

  {
  document.write("<fieldset><b>HSG output:</b> <br><hr><br>  &lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"  <br>  \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"&gt;  <br>  &lt;html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"&gt;  <br>  &lt;head&gt;  <br>  &lt;title&gt;" + document.forms["generatorform"]["nameofsite"].value + "&lt;/title&gt;  <br>  &lt;meta name=\"author\" content=\"" + document.forms["generatorform"]["nameofauthor"].value + "\" /&gt;  <br>  &lt;meta name=\"description\" content=\"" + document.forms["generatorform"]["descriptionofsite"].value + "\" /&gt;  <br>  &lt;meta name=\"keywords\" content=\"" + document.forms["generatorform"]["keywords"].value + "\" /&gt;  <br>  &lt;link rel=\"stylesheet\" href=\"" + document.forms["generatorform"]["stylesheet"].value + "\" type=\"text/css\" media=\"screen\" /&gt;  <br>  &lt;link rel=\"shortcut icon\" href=\"http://www.webmaster-talk.com/images/favicon.ico\" type=\"image/x-icon\"&gt;  <br>  &lt;/head&gt;  <br><br><hr></fieldset>");                                                                                                                  
  }

</script>

<p>Enter the name of your site:</p>

<form name="generatorform" action="generator.htm" onSubmit="welcome()">
<input type="text" name="nameofsite" size="20">
<br>
<p>Enter your name:</p>
<input type="text" name="nameofauthor" size="20">
<br>
<p>Enter the description of your site:</p>
<input type="text" name="descriptionofsite" size="80">
<p>Enter keywords for your site (seperate with commas):</p>
<input type="text" name="keywords" size="80">
<p>Enter the path to your stylesheet (if you have one, if not, don't even use this line, take it out):</p>
<input type="text" name="stylesheet" size="20">
<br><br>
<input type="submit" value="Submit">
</form>
There it is. That just makes a simple head section generator, which I am using here.

If you would like to use it, please keep the notice for my site and all in the top part. Please don't steal it.


I'm sorry if this has already been brought up, or just common knowledge anyway. Please don't roast me if so, as I said, I'm very proud of this. I've chosen to share it (even though you could just hack it anyway ) because I would like the world to know that it's possible!

And yes, the actual output code must be one long, very long line. If it's possible to clean it up (as I said I'm a noob) please say!
__________________
Check out my
Please login or register to view this content. Registration is FREE

Last edited by Physicsguy; 05-02-2009 at 10:12 PM.. Reason: Added Content
Physicsguy is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-08-2009, 05:28 AM Re: Generator - I think I've cracked the code!
ritetek's Avatar
Average Talker

Posts: 19
Name: Erik Guthrie
Trades: 0
There are hosts that don't support PHP?
__________________
Erik Guthrie
Ritetek Design

Please login or register to view this content. Registration is FREE

ritetek is offline
Reply With Quote
View Public Profile
 
Old 05-08-2009, 09:47 AM Re: Generator - I think I've cracked the code!
Average Talker

Posts: 20
Name: Nazia Naaz
Location: Karachi
Trades: 0
Quote:
Originally Posted by ritetek View Post
There are hosts that don't support PHP?
Some if you don't have premium account?
__________________

Please login or register to view this content. Registration is FREE
iamboredr is offline
Reply With Quote
View Public Profile Visit iamboredr's homepage!
 
Reply     « Reply to Generator - I think I've cracked the code!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11679 seconds with 12 queries