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.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26
  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    12
    Member #
    35903
    3.30.13

    I am looking to:

    1. Put a random custom daily quote (with an image of the person who says the quote), every time someone enters my site.
    Would I be able to do it on Webs.com? All it has is a "add a custom HTML" tab. If I am not able to use Webs.com to complete my objective, what would you suggest?

    2. I would like to put multiple custom chess tactics puzzles from a PGN file on my Webs.com website as well. I want it to be like Chess.com's daily tactics puzzle. http://www.chess.com/members/view/dailypuzzle. The puzzle is constructed so a player can move the piece. If the piece is moved correctly, it will make the computer move his piece, then the player moves a piece again to solve the puzzle. If the player moves the wrong piece in the puzzle, it won't let the player move the piece away from the starting square. I would also like to be able to have a tab under the puzzle where I can show the "help", "restart", and "solution" which is similar to the Chess.com daily puzzle. Will I be able to do it on Webs.com? If not, what would you suggest?

    Regarding above question 1, somebody posted on this site back in 2010 with a similar question: http://www.webdesignforums.net/threa...ay-code.30966/

    1. In the 2010 forum, mlseim states:

    A. "First, you have your text data file" Question for mlseim: how do I create a text data file? Can I write the sentences that I want in Notepad++ then save it to a ".dat" file? I couldn't find a ".dat" file when I selected "Save As".

    B. "Then I chose to use a PHP script that can be accessed using a Javascript." How do I create a "PHP script that can be accessed using a Javascript?"

    C. "You can echo using PHP if you wish." What does echoing using PHP mean?

    D. "Then I have the PHP script called "ponder.php" Did you convert the "ponder.dat" to "ponder.php"? If so, did you use Notepad++ or Eclipse?

    E. "Because I wanted it to work on ANY web page...without PHP, I am displaying it with a Javascript...like this:..." I see what you entered for the script. I am not sure what I am supposed to enter using Eclipse.

    2. In the 2010 Forum posting: AlphaMare states:

    A. "If you've only got 10 or 15 sentences, you could put them into an array using PHP like this...:"

    Question 1: What do you mean by an "Array"? Is that another word for a string?

    Question 2: How do I setup the PHP? Do I use Notepad++ or Eclipse? Do I then convert it from a PHP to an HTML by the "save as" to insert it into Webs.com?


    I am an absolute beginner with a little experience with JavaScript and XHTML. I found a website called: www.thenewboston.org. He has Eight Courses in Computer Programming and 22 Courses in Computer Science.

    I started doing the first 5 of 46 videos of "Xhtml &CSS" and the first 5 of 87 videos " of Java-Beginner."

    A. He has four different Java Courses.

    1. Java- Beginner

    2. JavaScript

    3. Java-Game Development

    4. Java-Game Development with Slick

    B. He has 2 different HTML courses:

    1. XHTML & CSS

    2. HTML5

    C. He has a PHP Course (200 videos)

    In addition to answering the questions that I asked, could somebody guide me in the right direction on where I should start in his tutorials to get me acquainted on what I need to do in the above questions?

    I really appreciate somebody's help being as specific as possible.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    I'm the guy that posted about the "random quote" script.

    Let's start at the beginning. Do you already have a website online? That would be the start because you'll need to use PHP for doing what you wish to do. If you don't have a website yet, the only other option is to install WAMP (your own website server) on your PC. That is going to be more advanced than you probably want it to be.

    Let us know about your website. And you can get your own site for only about $50 with a credit card, and that includes your own domain name. Pretty cheap in my opinion (a host like cleverdot.com).


  4. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    12
    Member #
    35903
    Hi Mlseim,

    "...Do you already have a website online?" Yes, I do have a free website. I am using www.webs.com. (My website address is available upon request.) I am not sure if they allow PHP extensions. In the Dashboard, all I saw was an "Add Custom HTML" tab.

    "...If you don't have a website yet, the only other option is to install WAMP (your own website server) on your PC." If www.webs.com isn't going to work for me, I have XAMPP control panel installed. Would you like me to install WAMP?

    "...That would be the start because you'll need to use PHP for doing what you wish to do." I went through the first few PHP tutorials in http://thenewboston.org/list.php?cat=11. Should I focus my time on going through the 200 videos on PHP first?

    "...And you can get your own site for only about $50 with a credit card, and that includes your own domain name. Pretty cheap in my opinion (a host like cleverdot.com)." If Webs.com isn't going to work for me, I did a search for cleaverdot.com, I noticed there were two choices,
    1. cleaver"D"ot.com and
    2. cleaver"B"ot.com
    Which one do you recommend?

    I would be willing to pay for your help with this.

    Thanks!

    Michael

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    cleverdot.com
    https://www.cleverdot.com/
    They have a one-year special ... $39.95 for one year and that includes a domain name.

    I'm guessing webs.com won't allow you to use PHP.

    The PHP scripting you need for the random quote is easy. But you'll have to learn PHP someday, so it never hurts to use tutorials. You'll learn the most by actually doing your own scripting on your own website.


  6. #5
    Junior Member
    Join Date
    Mar 2013
    Posts
    12
    Member #
    35903
    Hi mlseim,

    I purchased the special on cleaverdot.com. I got the website to work and added simple code to the website.

    Could you please explain to me, step by step, on what to do next?

    This is your explanatory code you gave to the gentleman back in 2010, (http://www.webdesignforums.net/threa...ay-code.30966/):

    1. <?php

    2. $quote
    = file("ponder.dat");
    3. shuffle($quote);

    4. Header("content-type: application/x-javascript");
    5. $string = str_replace(array("\r\n", "\r", "\n"), "", $quote[0]);
    6. $quo = str_replace("\"", "&quot;", $string);
    7. echo
    "document.write(\"$quo\")";
    ?>



    1. In line 2, I don't understand why you named your file: "ponder.dat." Did you save your quotes to a .txt document or a .dat document?

    2. I have a list of quotes. Do I save it as a .txt?

    3. Do I save my list of quotes in the same folder as my "index.html" file?

    4. Do I add the name of my "quote file" in line 2? Do I copy and paste everything from line 3 down, ending with ?> within my HTML document?

    My email address and phone number are available upon request,

    Thank you for your help,

    Michael






  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Let's start ... by steps.

    1) Your main index file is called "index.php" (not index.html).

    2) You create a file that has your quotes ... each quote is on a line by itself.
    You can use notepad or we all prefer Notepad++ (google it). Notepad++ is great for coding PHP because it highlights code. And it's great for basic text files too.

    3) Save your quote list (file) as anything you want, in the same directory as your "index.php" file. I used the name "ponder.dat" ... I just made up .dat you can use .txt, .dat, .ftw ... whatever you want.

    4) the same as your step 4 ... which is all correct.

    Any file you have with a .php extension will be processed as PHP. The server will process the scripting before it sends it to the user's browser. So, if your main page is called "index.php", the server does all of the PHP scripting inside of your file (mixed with HTML) and serves it to the browser. The user only sees the resulting HTML ... they don't see the PHP scripting.

    Here's an example of a typical "index.php" file ...
    PHP Code:
    <html>
    <head>
    <title>my page</title>
    </head>
    <body>
    This is my page ... blah blah blah
    <br />
    <br />
    Here is the quote of the day ... <br />
    <div>
    <?php include("Myquote.php");?>
    </div>
    </body>
    </html>
    When the server hits the include part, it will stick the output of that script in that exact spot on your web page.

    Here is "Myquote.php" ... and your quote file is called "quote.txt" ...
    PHP Code:
    <?php
    $quote 
    file("quote.txt");
    shuffle($quote);
    $string str_replace(array("\r\n""\r""\n"), ""$quote[0]);
    $quo str_replace("\"""&quot;"$string);
    echo 
    $quo;
    ?>
    You can use a test script called "test.php" instead of "index.php" if you wish .. just for testing.

    Let me know if you can get it to work (give me the URL to it).
    Then we can expand to include an image (photo).


  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    And then, this thread will be moved to the PHP section .... this will be a PHP discussion.


  9. #8
    Junior Member
    Join Date
    Mar 2013
    Posts
    12
    Member #
    35903
    SUCCESS!!!!!!!!!!!!!!!
    THANK YOU!

    Here is my url: www.1776infowarrior.com

    I would like to try to figure out how to insert the pics myself.

    "And then, this thread will be moved to the PHP section .... this will be a PHP discussion." Will I keep Posting/replying to this thread?

    How do I go about doing the custom chess tactics puzzles mentioned in the first thread?

    Thanks again!

    Michael

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    A hint on the pictures.

    Put all of your pictures in their own directory, perhaps you call it images.

    Then, on each quote line, add the name of the picture file. Separate the quote from the filename with a pipe |

    This is my quote, blah blah blah|johnsmith.jpg

    When a line is taken from the quote file, you can "explode" that line and get two things ... the quote and the photo. Use Google, search for: PHP explode


  11. #10
    Junior Member
    Join Date
    Mar 2013
    Posts
    12
    Member #
    35903
    1. "Put all your pictures in their own directory, perhaps you can call it images." I transferred the images to my "public_ HTML directory"

    2. "Then, on each quote line, add the name of the picture file. Separate the quote from the file name with a pipe |" No problems completing this task.

    3. "When a line is taken from the quote file, you can "explode" that line and get two things...the quote and the photo." After viewing the three examples on: http://php.net/manual/en/function.explode.php, I am unsure of how to proceed.


Page 1 of 3 1 2 3 LastLast

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 10:18 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com