Jump to content

micah1701

Members
  • Posts

    613
  • Joined

  • Last visited

Posts posted by micah1701

  1. thanks for your input. Seems to firm up what I'm coming to realize, its just not possible.

     

    I have an ajax based page that loads content with javascript and simultaneously appends the url with a /#!/shebang tag to keep it SEO friendly with google.  The only problem is, if JS isn't enabled, obviously the content can't load. I wish I could still use the anchor tag urls AND preload the content.  Oh well.  Guess its back to old fashioned ?variables=in_the_url  :(

  2. if the url is my-domain.com/some_page#here_is_an_anchor is there anyway to read that anchor value server side?

    parse_url() shows that it can parse the value, but the examples for that function are setting the value of the URL as a string, hard-coded into the script.  I need to detect the URL dynamically.

     

    My suspicion is that this is impossible but I figured it can't hurt to ask.  Thanks for any advice.

  3. the problem is an issue of server-side vs client-side scripts.

     

    the variable $cpuspeed that you're outputting is sent from the server side to the user's browser where javascript (a client-side script) uses it in its function.

     

    Once the the serverside has sent its variable to the browser, thats the end of it.  Unless you're doing some tricky AJAX stuff where the browsers constantly talkes to the server, what you're trying to implement just won't work.

  4. :o I can't believe it was that simple.  All the documentation (which I'm guessing is for version 1.x) shows it with a capital 'S' -- and its always worked that way in the old version.  I can't believe it was so hard for me to find the answer to my problem, you'd think other people would have the same issue.  :shrug:

     

    There was another place I was having trouble using CKFinder, without CKeditor, but based on this new knowledge, I changed:

    CKFinder.Popup( { BasePath : '/ckfinder/' });

    to

    CKFinder.popup( { BasePath : '/ckfinder/' });

     

    and what'dya know it works!

     

    :D THANK YOU SO MUCH!!!  :D

     

  5. you have one to many closing brackets `}` in your if/else statement

     

    change:

    if(isset($_POST['visitortitle']))  {$visitortitle = $_POST['visitortitle'];} else {$visitortitle = 'Nothing Selected';}

     

    to:

    if(isset($_POST['visitortitle']))  {$visitortitle = $_POST['visitortitle'];} else {$visitortitle = 'Nothing Selected';

  6. perhaps your SMTP server has over zealous spam filtering.

     

    what if you change:

    <option value="JOB OFFER">Design Contract</option>

    <option value="PURCHASE ORDER">Purchase Order/Offer</option>

    to

    <option value="Design Contract">Design Contract</option>

    <option value="Some other Value without spam-like keywords">Purchase Order/Offer</option>

  7. might not solve your problem but you should change:

    trim(stripslashes(mysql_real_escape_string(md5($_POST['password']))))

    to

    md5(trim(stripslashes($_POST['password'])))

     

    the functions work from the inside out.  so once you've md5()'d the word its not going to need to be real_escaped_string()'d anyway and it won't need to be trim'd or striped of slashes because you'll just have your md5 hash which doesn't have those things.

     

  8. there are toggle functions built into framework languages like jquery that might, but what I would do in your situation is set a js variable that tells you the current state of the div. then when the link is clicked, do the opposite and update the state.

     

    var display_div = false;

    function display_or_hide(){

      if(!display_div){

      document.getElementById('theDiv').style.display='none';

      display_div = true;

      }else{

      document.getElementById('theDiv').style.display='block';

      display_div = false;

    }

    }

     

    then set your html like:

    onClick="display_or_hide()">Show div.</a>

     

  9. its an issue of strtotime converting your date with dashes in it.

     

    $date_begin = strtotime($sistdag); // at this point, its converting what you think is d-m-y  but it thinks that is y-m-d.

     

    if you change

    $sistdag = date('d-m-y',strtotime('last ' . $roday));

    to

    $sistdag = date('y-m-d',strtotime('last ' . $roday));

    it will solve your problem

     

     

    for more info, see also: http://us2.php.net/manual/en/function.strtotime.php#100144

  10. sorry for taking a while to get back to you...

     

    I didn't really look through your code so I didn't see that you already have a variable.  You don't need to create a new one if you're already grabbing it from the database.

     

    The point really is that you need to pass the file name of the larger image to the javascript function so it can populate the <div> with the correct image.

     

    so when you (1) click on the thumbnail, it triggers (2) the javascript function which (3) updates the HTML within the <div> to show the larger version of the image.

     

    in step 1, we're using the "onclick" event in the link to call the javascript function and we're including the name of the file to display.

    in step 2, we're taking that passed file name which is now a javascript variable and...

    in step 3, we're using javascript to update the div.

     

    hope that helps clear it up a bit.

     

    if you have more questions, you might want to post the code you've got so far in the javascript forum :)

  11. I think your on the right track, although, this tread should probably be in the javascript forum.

     

    You need to do something like,  on each thumbnail, modify the code from:

    <td height="60"><img src="<?php echo "$frontimage"; ?>" width="65" height="65" /></td>

    to

    <td height="60"><img src="<?php echo "$frontimage"; ?>" width="65" height="65" onclick="load_image(<?php echo "$frontimage_big"; ?>)" /></td>

    (where $frontimage_big is a variable containing the file name of the larger version of the image)

     

    Then create a little javascript function named "load_image()" as refereneced by the above "onclick" event:

    <script type="text/javascript">
    function load_image(image_name){
      document.getElementById('big_image_div').innerHTML = "<img src=\""+image_name+"\" />";
    }
    </script>

     

    lastly, modify the area where the large image is displayed by giving it a container with the name "big_image_div" - as referenced by the above javascript snippet.

     

    something like, change:

    <td valign="top"><img src="<?php echo "$mainimage1"; ?>" width="340" height="440" name="MainImage" /></td>

    to

    <td valign="top"><div id="big_image_div"><img src="<?php echo "$mainimage1"; ?>" width="340" height="440" name="MainImage" /></div></td>

     

  12. i think your missing the point of using a loop!

    all you need to do is:

                <li>
                <span id="sun">Solar System Star</span>
                <p>The Sun is a star, a hot ball of glowing gases at the heart of our solar system. Its influence extends far beyond the orbits of distant Neptune and Pluto. Without the Sun's intense energy and heat, there would be no life on Earth. And though it is special to us, there are billions of stars like our Sun scattered across the Milky Way galaxy.</p>
                </li>
    <?php
    $res = mysql_query("SELECT * FROM `planetsTable` WHERE `section` = '1' LIMIT 9 ASC");
    while($row = mysql_fetch_array($res)){ ?> 
            <li>
                <span id="<?php echo $row['name'] ?>"><?php echo $row['name']; ?></span>
                <p><?php echo $row['name_of_column_holding_the_description_about_this_planet'] ?></p>
            </li>
    <?php } // end of loop through all the planets ?>

  13. Cheers, that seems easy enough and shouldwork fine. The last thing i would like to know is what would happen if say two people where using the site at the same time. Small chance but still worth thinking about? Like will there be a queue as the collect ID is in the same function already being run.

     

    if you are really concerned about Internet race conditions, where mysql_query() is executed in two different scripts simultaneously and therefore mysql_insert_id() returns the wrong id value, than you could *not* use mysql_insert_id() and instead do a query for the data you just entered.

     

    so like:

    <?php
    session_start();
    mysql_query("INSERT INTO table_name (col_1,col_2,user_token) VALUES ('val_1','val_2','".session_id()."') ");
    $get_mysql_inserted_id = mysql_query("SELECT `id` FROM table_name WHERE user_token = '".session_id()."'");
    $id = mysql_result($get_mysql_inserted_id,0,0);
    echo $id; 

  14. could be a couple things.  are you sure you really have 3 images where SKU = $sku?  perhaps there is a whitespace or a capitalization difference you're not noticing.

     

    could it be that you're missing the path or some other info in the database?  when you run the script and view the outputted HTML source code, does it only show HTML for 2 images? or does it show 3 but one of them isn't displaying?

  15. to clarify, you have a <textarea> form field where people enter several items and you want each of those items to be put in an array?  Are the items always seperated by a carrage returns (ie, does the user hit the "enter" or "return" key while typing to seperate each item? if so

     

     

    $my_array = explode("\n",$_POST['text_area_name']);  //  "\n"  means line break

     

    print_r($my_array); //ta-da!

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.