News Posting?

  • 1337Punisher
  • Born
  • Born
  • 1337Punisher
  • Posts: 2

Post 3+ Months Ago

Hi, total newb and happy for any help I get.

Ok, I would like a page with a textbox, textarea, and submit button. When I press the submit button it posts the textbox text in a small table, then the textarea text in a large table below the small table. But the problem I want it to post it on another page. I'd like if it was possible to do in Javascript so I do not have to find a new server that supports asp/cgi etc.

thx in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

You won't be able to do any database driven work without a server that supports php or asp. What you are trying to accomplish envolves server side programming, which JavaScript isn't. JavaScript gets parsed once it is sent to the client, so any changes made are only seen on the clients end (for instance JavaScript and cookies). Likewise PHP and ASP are parsed on the server before they are sent out (the reason you can never see a source of a php file).

Similarly JavaScript can't interact with any server based database, because it is client side, and PHP can't detect, for instance, the clients browser, because it is server side.
  • 1337Punisher
  • Born
  • Born
  • 1337Punisher
  • Posts: 2

Post 3+ Months Ago

Well I would be willing to get an asp/php server I used to have one but didn't like ftp uploading, anyways could you supply me with asp and or php code to do this, becasue if thats my only option I will get a new host.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Actually, PHP can determine the user's browser type :)

For PHP 4.1.0 & higher
Code: [ Select ]
echo $_SERVER['HTTP_USER_AGENT'];

For earlier versions...
Code: [ Select ]
echo $HTTP_SERVER_VARS['HTTP_USER_AGENT'];

But yeah, B_Heyer's right.. You won't be able to do anything like this without a server-side scripting language & database. JavaScript is all client-based. Nothing executes on the server, just the machine that's being used to browse the site.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Ahh sorry, I knew that, I got it confused with screen resolution. I was just trying to think fast and that came before the actual one did. :-P
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Yawn, I need some sleep.

test.html
Code: [ Select ]
<html>
<body>
<input type="text" id="tbox">
<textarea id="tarea" cols="10" rows="2"></textarea>

<a href="retest.html" target="_BLANK">test</a>

</body>



</html>
  1. <html>
  2. <body>
  3. <input type="text" id="tbox">
  4. <textarea id="tarea" cols="10" rows="2"></textarea>
  5. <a href="retest.html" target="_BLANK">test</a>
  6. </body>
  7. </html>


retest.html
Code: [ Select ]
<html>
<body>

<table><tr>
<td id="out"></td>
</tr></table>

<BR><BR>

<table><tr>
<td id="out2"></td>
</tr></table>
</body>

<script language="javascript">
out.innerHTML = window.opener.tbox.value;
out2.innerHTML = window.opener.tarea.value;
</script>

</html>
  1. <html>
  2. <body>
  3. <table><tr>
  4. <td id="out"></td>
  5. </tr></table>
  6. <BR><BR>
  7. <table><tr>
  8. <td id="out2"></td>
  9. </tr></table>
  10. </body>
  11. <script language="javascript">
  12. out.innerHTML = window.opener.tbox.value;
  13. out2.innerHTML = window.opener.tarea.value;
  14. </script>
  15. </html>


everyBODY has a name :D

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 56 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.