Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Feb 2013
    Location
    Bangor, Maine
    Posts
    12
    Member #
    35395
    I have two java document functions.
    Code:
    document.getElementById('calendar2').innerHTML = calendarbuild2;
    Code:
    document.location = 'calendars/201303.php';
    the value of calendarbuild2 is 201303.php but changes with each month of the year.
    i need to use document.location to put the php file into a division of my index.php file where the to java lines are coded.
    is there a way to combine the two functions so the location pulls in the file but uses the calendarbuild2 code?
    both codes work individually but the document.location replaces the current page and I want it to load into a division. i currently have:
    Code:
    <div id="calendar"></div><script type="text/javascript">document.location='calendars/201303.php';</script></td>

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Is this an actual PHP script? 201303.php

    What does that script do?

    And maybe you have a web page that demonstrates what is supposed to happen?


  4. #3
    Junior Member
    Join Date
    Feb 2013
    Location
    Bangor, Maine
    Posts
    12
    Member #
    35395
    201303.php is a php file that is a calendar for one particular month. it displays each month pulling certain criteria using mysql.
    you can see index.php at www.davidsdomaindesign.com/out/index201303.php
    among other things, the javascript portion of the index.php shows month/year combination with a prior and next buttons. my original intent was to use an include function for 201303.php in the calendars directory. i need the document.location because the javascript in index.php changes the filename to 201303 or 201302 based on prior or next. does this make any sense?

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Does not make sense to me.

    Are you saying that you actually create a new PHP script each time the month changes?
    Why isn't there one PHP script called "calendar.php" that can display a calendar for ANY month?

    I've never heard of creating many PHP scripts that perform the same function. Using one script is sort of the whole point of using PHP. You would tell PHP to display the calendar of your choice by providing a URL variable. Example: calendar.php?m=201303

    One PHP script displays any month for any year.

    Again, I'm perplexed.


  6. #5
    Junior Member
    Join Date
    Feb 2013
    Location
    Bangor, Maine
    Posts
    12
    Member #
    35395
    you are correct in what you understand. there is a different php for each calendar month. the reason for this is because i do not know how to create a php that would do what you are proposing. do you know of a way to do what i now have?

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Actually I don't know. Can you post one of your calendar scripts?


  8. #7
    Junior Member
    Join Date
    Feb 2013
    Location
    Bangor, Maine
    Posts
    12
    Member #
    35395
    this is 201303.php but i had to rename to txt for uploading purposes.

  9. #8
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Holy Toledo!
    Where did you get that script? Is it something you found or did you make it up?
    And how long does it take to display a calendar (time for page to load)?

    I'm still soaking it all in.

    Is it possible to show us a test page or somewhere that we can see what that script does on the browser?


  10. #9
    Junior Member
    Join Date
    Feb 2013
    Location
    Bangor, Maine
    Posts
    12
    Member #
    35395
    HTML Code:
    http://www.davidsdomaindesign.com/out/calendars/201303.php
    this is the code for this month. it should insert into
    HTML Code:
    http://www.davidsdomaindesign.com/out/index.php
    clicking on a letter which is described in the index file loads the calendar of events for that catagory on that date.

    this popup page is not complete, i'm working on the "more..." to display details and segerating each calendar by area/county/city within the state of maine.

    i only know how to achieve this complexity with seperate php files for the months. they are not that hard to code. its only file duplication and changing where dates start and how many days of the month. i'd like to keep this format if possible.

    thanks for your help.

    david

  11. #10
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    how many variables are common in each script? can 032013 be a variable?



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com