Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Question for Nog and others.

  1. #1
    Join Date
    Mar 2006

    Question for Nog and others.

    Hello Nog I hope you see this, or someone else who knows this answer please help. Anyone who has been around the block enough to have heard if this can be done. Does anyone know of a way with either php or javascript that something can create the web pages you want for you, and then uploads them to your site? At least something that creates the web pages, I can even upload them myself. What is happening is I am taking software programs and they come in so fast I can't keep up. It would be easier to have the pages made for me and then the ones I don't want I could just delete online. This making each page from scratch all the time is too much work and take up way too much time. Burnt out in web land.

    Please let me know if this can be done, I'll even hire someone if I have to. Thanks a whole lot.

  2. #2
    Join Date
    Mar 2006
    If it absolutely cannot be done with javascript and php if there is some sort of program available that will do this? Thank you.

  3. #3
    Join Date
    Mar 2006
    I found this link, this is exactly what I need. http://www.sitepoint.com/article/pub...mysql-data-web

    I am having trouble learning how to do the plug in. The thing that sends the mysql data put on the page, to the web server. I already know how to use php to put the mysql data on the page, I just don't know how to get it dynamically sent to the server.

  4. #4
    Join Date
    Mar 2006
    Someone sent me a private message who might be able to help, if they can't I'll let you all know.

  5. #5
    Join Date
    Mar 2006
    The last person wasn't able to help me with what I needed. According to the link I posted above, it says a php plug in can be made to take an updated web page and send it on somewhere to the server. Thats exactly what I need. This is basically what the article above says:

    "The PHP script outputs the mysql content as part of the Web page. (which I can do)

    A PHP plug-in finishes up by handing a copy of the HTML to the Web server. (which I don't know how to do)"

    I need help with the last above line. If anyone can help, please private message me. Or suggestions only that might help, please post here. Hope someone can help. Thanks very much.

  6. #6
    Join Date
    Jun 2007
    Do you mean that you want to know how to save the generated HTML as a separate, static HTML document? ...or, are you wanting to download (rather than merely display in the browser) the generated HTML document?

  7. #7
    Join Date
    Mar 2006
    Thanks so much for asking.

    The page is already appearing in the browser using a form, mysql, and php. Visitors are already adding their data to the page. So the answer is "how to save the generated HTML as a separate, static HTML document."

    I was hoping per example in above article that since I am already using php to do all the just listed above, that maybe an if statement, while the data is being put on the page, would also send the data and page onto the server in a directory anywhere.

    I thought since all the code is already written in php that just adding an if statement to the already there code would be the easiest way. But if someone can think of another way, that would be fine.

    I'm confused on something. If the page was then sent on to the server, wouldn't it just be back to its original state when the page was first opened in the browser without the data yet added?

    If so, how are people pulling their database info and generating pages automatically with it? I don't believe they are all doing this manually, many people have way to many web pages to do them all one at a time.

    Please get back to me, thanks.

  8. #8
    Join Date
    Jun 2007
    The first question to be answered is how to save the generated HTML as a separate, static HTML document. To do that, the easiest way is to turn on output buffering and point it to your function to create the static HTML document (that function can use the global statement to gain access to any variables in your page which may be required for the purpose of, for example, naming the saved document and pointing it to the correct folder):
    PHP Code:
    Then, when you're done generating the HTML, execute the following function:
    PHP Code:
    So, the only part left is the function to save the generated HTML:
    PHP Code:
    function save_html($output)
    $fp fopen($path_and_file_info'w');
    return $output;

    This function both writes the generated HTML to a file and returns the generated HTML to the output handler which, then, sends it on to the client.

  9. #9
    Join Date
    Mar 2006
    I can't send you a pm cause don't think you have it so I'll have to list it here. You seem to really know what your doing so I hope you'll let me find out if your approach will do what I need. Can you please explain to me what an output handler is? For the client I think your talking about the browser.

    Does this turn or copy everything into a web page? If so, how can I send it onto the server? Please get back to me, thank you very much.

  10. #10
    Join Date
    Jun 2007
    The output handler is outside of your code. It is what actually sends the output from your code to the client (the browser). Output buffering is a function of the output handler. Thus, it is the output handler which calls back your function when you request the output buffer to be flushed to the client. The output handler sends the content of the output buffer to your function as a single string argument. This gives your function the opportunity, if desired, to modify the output buffer before it actually gets sent to the client by the output handler. Once your callback function is done with the buffer the only thing your function has to do is return that buffer to the output handler for processing.

    The end effect of the code I've given you is that the generated HTML is both sent to the client and is saved as a static HTML document on the server.

  11. #11
    Join Date
    Mar 2006
    Are you serious? That sounds pretty exciting. Where will it send the document on the server, so I can find it to send it to other directories if needed? I would imagine it goes in one of your variables, but I can't tell which one.

  12. #12
    Join Date
    Jun 2007
    This statement:

    global $path_and_file_info;

    points to a normal variable you define anywhere in your page before you execute this statement:


    And the callback function has to be defined before you execute this statement:

    Last edited by temp.user123; 07-07-2007 at 11:33 PM.

  13. #13
    Join Date
    Mar 2006
    The only thing I need to know is if it will save the whole web page to the server. It sounds like you are saying it will. Also if I set a server destination, but the same code is in the page, when it uploads a next page to the same location, it will keep replacing the one before. Unless you know of a way to add a number to the name of the each file in the code so each page has a slightly different name. That way it will just keep adding them all without overwriting anything. I would imagine that can be done. If you think all that checks out, I am very, very, interested can you help me finish it? Do you have an email? We can talk about payment then as well. Please let me know, thanks a lot.

  14. #14
    Join Date
    Jun 2007
    It will save everything you output between the:
    PHP Code:
    and the:
    PHP Code:
    statements. If you want a different document name to be generated each time it is saved, then this is one way that could be accomplished:
    PHP Code:
    function save_html($output)
    $suffix 0;
        while (
    $parts pathinfo($path_and_file_info);
    $path_and_file_info $parts['dirname'] .
    '/' basename($parts['basename'], '.'.$parts[extension]) .
    ' (' . (++$suffix) . ').' $parts[extension];
    $fp fopen($path_and_file_info'w');
    return $output;

    Last edited by temp.user123; 07-08-2007 at 12:23 PM.

  15. #15
    Join Date
    Mar 2006
    Thanks a lot, I've been reading up on this all day to see if I can learn what I'm doing. Looks like a whole new world. In the code you just listed is that a total call back or do I have to write separate for that? Only because what I have isn't working yet. It looks like you're saying, "while this page exists, send a copy of it to a particular directory." Let me know if I am reading that wrong. I put these here ob_start('/test.html'); and $parts['/uploadedfiles/']. From what I've read, it looks like I only need the directory path. Or do I need the full path? http://www.awebsite.com/ etc.
    Thanks very much.
    Last edited by Rianna; 07-09-2007 at 10:23 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.17209 seconds
  • Memory Usage 3,011KB
  • Queries Executed 13 (?)
More Information
Template Usage (36):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (72):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates