SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    London, UK.
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I run an online business writing verse and designing cards. My active site was written by a programmer (who no longer is in this line of business) and I am at present, learning and building my new one by myself.

    I am using Dreamweaver to do this but the problem I'm having is how to set the variables. Previously it was done using javascript and forcing each page into a frameset(I only have 13 cards on the active site but intend to upload more than sixty on the new site.) I would prefer not to use framesets on the new version.

    I have designed a series of pop-up windows, each displaying a card design, when activated. In these windows, I have an "order this cardstyle" button which I want to, when clicked, read as 'true'. I know this is obvious but please bear with me, I'm a novice.

    This should then be seen, when going to the order form page, as a checked radio button that corresponds with the same cardstyle that was clicked on that specific page.

    My worry is that if the visitor goes to another page in search of other card designs, the card style reading as 'true' will be returned back to 'false'. Hhence the need for global variables.

    I would like for the user to be able to order more than one cardstyle, should they require it, (though in most cases, the user is likely to choose only one). Therefore the radio buttons are not an 'either/or', they are an 'and'. For this purpose, I have just used radio buttons, however, there will be a need to use list boxes in order for the visitor to choose one of up to six colourways.

    I have been advised by a fellow member here to use php language but know absolutely nothing about it (neither do I know that much about any other languages but I'm learning).

    Would anyone be able to assist me in solving this problem or at least tell me where I can visit to find out?

    Also, am I able to mix languages e.g. javascript and php?
    jan

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol...you won't care about javascript after you learn php. javascript is kiddie stuff. php is the real deal.

    See this thread for resources:

    http://www.sitepointforums.com/showt...threadid=18699

    Javascript occurs on the "client side", which means the user's browser executes the code. php occurs on the "server side", which means the server(a computer) at the company that hosts the web site executes the code. The result is that the two languages happily coexist, but things that can only be accomplished with very tortured programming on the client side with Javascript can be done very easily with php. Why does anyone use Javascipt then? One reason: speed. Whenever you have to make a request to a server to execute some php code, you are subject to the load on the server at that time. Javascript essentially executes instantaneously. php is extremely fast, but ultimately its speed can be compromised by an overloaded server.
    Last edited by 7stud; May 17, 2001 at 12:05.

  3. #3
    SitePoint Member
    Join Date
    May 2001
    Location
    London, UK.
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advice. Have visited the thread you suggested and found it interesting but I'm still struggling in the dark a little!

    Do I need a UNIX environment on my PC to develop on php?
    For example, if I download some php scripts, one I have seen sounds what I think I need but it's Readme mentions UNIX and MySQL. Does that mean if I download these scripts and want to change them, I cannot get to the source without a UNIX environment. Perhaps you're not the person to ask but if you could help, I'd be more than grateful.
    jan

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    php is platform independent, so you can develop on any environment. Developing php locally is the easiest way to go, otherwise you have to make changes to your script, upload them to your web host, and see if they work. Then go through the whole uploading process 100's of times till your script works. If you have php/mysql/apache on your local machine, you can turn your pc into a webserver, so that it acts like both a client and a server which makes testing very easy. When your script is complete, you just upload it once to your web host.

    The nice thing about php/mysql/apache is that all the software is free, free, free. It can be a slight pain to install though. If you have windows 9x, there is a great preconfigured package you can down load that all you have to do is unzip and you are ready to go:

    http://www.firepages.com.au/devindex.htm?from=dev3

    Once you have everything installed, then you have to learn how to use everything, which requires that you do these exact steps, otherwise your php script won't run:

    1) Your script must have a .php extension
    2)Your script must be saved in what is called the "document root" but the folder is not named "document root" it is named "htdocs" or "www" among other things.
    3)Apache must be running
    4)You must open a browser window and type:
    http://localhost/filname.php in the address bar to execute your script. You cannot click on your script's icon to run it.

  5. #5
    SitePoint Member
    Join Date
    May 2001
    Location
    London, UK.
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I shall definitely take a look at the software you've suggested and take it from there.

    Must away to bed ..1.00am here in London!

    Thanks again. Nice to have such helpful folk on this site.
    jan

  6. #6
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For the record, you'll probably want to implement your global variables as PHP session variables. Once you've got a basic grasp of the PHP language, check out my 'Managing Users with PHP Sessions and MySQL' article in the Coding section of WebmasterBase.com to learn about session variables.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  7. #7
    SitePoint Member
    Join Date
    May 2001
    Location
    London, UK.
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Kevin.
    Have taken note of your suggestion. Just hope it shouldn't take too long to pick up a basic grasp of php, though I would imagine it's likely to take longer than I think.
    jan


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •