Thread: An easy one...

Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0

    An easy one...


    Ok... I'm sure the answer to my question is very simple... but I'm a web designer .. not a developer.. I just sort of fell into this whole web business in the first place.

    Here's what I want to do...

    Create a web site that tracks a virtual stock market, with market data (ie share price) updated by individual registered users on the web. This information is compiled in a database and individual entries can be called by any page on the internet (for example, I want to let everyone know how my virtual company is doing on my geocities Web site.)

    Updates can be made on my site but ideally (I'd be as happy as pie) any registered user would be able to update their company on any page that links to the database (ie, a geocities site)... but the site would automatically know who it is and update the proper company.

    Unfortunately I don't know too much about scripting technologies ... what I'd really want is someone to point me in the right direction... what would the best place for me to start? php? jsp?

    Any help would be great...
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    6
    Rep Power
    0
    <-- its thata way chief!

    Ok seriously.
    PHP would be great IF you were on an apache server... but services like Geocities just won't cut it. You should look into geting your own server, and running something like the ever-common Apache 1.3/PHP4/MySQL combo.

    For your virtual companies, you could set up a database with a table called "company" and have it store all these variables for you "open_price", "close_price", "change", "date" or something like that. Then you have some options - A) use .htaccess for user-authentication, or B) make a table in your database that can store the user info. B is far simpler, but for that same reason, far more insecure than using http-sessions and .htaccess.

    Hope that gives you a starting point.
    Any more questions (or if you need a site to host this project off of) email me cirox@stealthx.com. I'de be glad to help.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0
    Thanks for the info...

    I know databases and that side of it.. but what I can't figure out is how to get information in my database on my server displayed on your website.

    I'm really sorry if I'm not explaining this clearly.

    Here's an example of the kind of thing I'm looking for. www.tag-board.com offers a chat-like function that anyone can add to their website.. it can be used on free hosts because (it seems to me) all the work is done on the tag-board site.

    Can I just have them call a javascript file on my server and have that file return results from the database?
  6. #4
  7. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    You need:
    1. a server (http://www.apache.org/).
    2. a server side language (http://www.php.net/).
    3. a website.. (you provide).

    You need to learn:
    1. the server
    2. the language
    3. basic CGI programming concepts (Hero Zzyyxx posts a link to a very good online tutorial from time to time in people's posts, especially in the perl forum. Search the forums for cgi tutorial to find it).

    Javascript is generally client-side. You use server side languages like perl or PHP to database work.
  8. #5
  9. 11
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jul 2001
    Location
    Lynn, MA
    Posts
    4,635
    Rep Power
    82
    And here it is!

    Your clown scares me. . .
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0
    Thanks for the info..

    "rtfm" lol..

    Everything I've read through so far on PHP is all about what gets displayed on my site...

    Surely someone on geocities can't just query the database on my server? Can they? This is the part I haven't found any information on at all. Maybe I just have a mental roadblock or something... that's why I called this thread "An easy one.."

    If the information was being displayed only on my site I wouldn't have any problem at all as the rest of it is QED.
  12. #7
  13. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    14
    No because you can't use PHP/MySQL on GeoCities.... There are no server side technologies allowed at Geocities.
    Hartmann
    badice.com
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0
    That's what I figured..

    So how can it be done?

    I've really appreciated everybody's input on this... and thanks to Hero Zzyzzx for the tutorial link... it'll help the authentication bit quite a bit.
  16. #9
  17. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    I don't understand what you're trying to do I guess. You just want to set up a website that uses a database, right? Nothing special, just put up a website on a server that uses a database on the same server, right?

    Hero.. you don't like my clown? Don't make my clown come over there....!
  18. #10
  19. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    You CAN do it with javascript, actually. Well, sorta. When you include an external javascript file in your page, it doesn't have to be a .js file. I know this because I've successfully included a jsp file that dynamically creates the paths for several image swaps. Whatever file you point the src attribute of the script tag at just has to return valid javascript.

    So, like everyone else has been saying (and it sounds like you already know), knock yourself out with php/perl/jsp/asp/zope/c/c++/python/insert-custom-language-here , but create your page so that it returns javascript rather than html.
  20. #11
  21. Web Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2001
    Location
    Pennsylvania
    Posts
    171
    Rep Power
    0

    Querying from Geocities


    Hmmm, correct me if I am wrong, but can't you connect to a mySQL server by IP address with the Java language? Thus, would a java applet be able to query the database and display the results? Then any webpage that wants to display this information just downloads and inserts the applet into their page.

    I am only a beginner in Java, but in my head, it sounds like this should work.
  22. #12
  23. An Ominous Coward
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jan 2002
    Posts
    4,425
    Rep Power
    0
    Ermmm.. there's a whole lot of unnecessary kludging going on here. You just need to select a web hosting service that lets you use server side scripting technologies such as perl, php, etc. and also offers database access. That's it. Honestly, I hate to say it but if your site is going to sit on Geocities or some other "free webpage" service, you're pretty much SOL on dynamic content, database or otherwise...
  24. #13
  25. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Ctb, you're missing the problem. Xoltaric's cool with that backend stuff, it's getting content generated by server A (php/mysql) to display on server B (geocities/etc.), that's the problem.
  26. #14
  27. 11
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jul 2001
    Location
    Lynn, MA
    Posts
    4,635
    Rep Power
    82
    Create your pages in whatever language you wish on a server that supports whatever server-side scripting language you wish.

    Using cron jobs, create static files that your write out to the file system, perhaps named with the username of those in your system.

    Then figure out how to deliver these pages to your users on crappy hosting services like GeoCities- the most likely culprit would be to use iframes, which they would just put into their static pages. These iframes would load the content from your site. Look into iframes, if you haven't already, they are pretty easy.

    Aside from getting their FTP info, you're going to have to host the mini-pages on your own site if they don't use a host that supports web scripting languages.

    Netscape 4 apparently doesn't support iframe. . . TOo many eyes. . .<twitch>
    Last edited by Hero Zzyzzx; September 11th, 2002 at 08:51 PM.
  28. #15
  29. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0
    Thanks bricker for helping to clarify!

    But Hero... I think you are my hero.. That'll totally work.

    Actually couldn't I just use iframes to call the script, which would return html? I can pass the username through the src like this:

    <iframe src="http://www.myserver.com/my.script?name=username" width="125" height="250"></iframe>

    If so, that's EXACTLY what I'm trying to do.

    See, I told you it was easy...

    *runs away to avoid sharp projectiles*
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo