Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 3 FirstFirst 123
Results 31 to 44 of 44
  1. #31
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    WELL OF COURSE NOT!

    You are doing this:
    Code:
    redir();
    showmessage();
    So you are redirecting to the other page *BEFORE* you show the message!!!

    How do expect that to ever work?

    location.href changes happen *IMMEDIATELY*. Once you do one of them, *NOTHING* else on the current page will happen.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  2. #32
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    i was thinking it would refresh the page, then show the message after that. Executing the functions in order.

    So if i need to reverse them then that is fine i can do..

    showmessage then redirect. But if that is the case then i will need to add something to my message like a button.

    in other words i need to show the message then stop and tell the user that they need to refresh the page to see their song on the list.


    i can set in php this..

    PHP Code:
    $btn "<input type='submit' name='submit' value='Please click to refresh the page' onclick='redir($gowhere);' />"
    then in my showmessage function i should be able to do this

    Code:
    function showmessage()
    {
    var smsg = "<?php echo $showmesg; ?>";
    var btn = "<?php echo $btn; ?>";
    
    document.getElementById('showmsg').innerHTML=smsg + btn;
    
    }//close function showmessage
    
    function redir(val)
    {
    window.location.href = val;
    }//close function redir
    
    showmessage();
    that way they will see any message then they can push the button to refresh the page.
    Last edited by durangod; 07-09-2013 at 01:27 AM.

  3. #33
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    I *still* say you'd be better to do the redirect and then show the message in the redirected-to page.

    How you send the message to that redirected-to page is up to you: I don't see anything wrong with putting it in the query string. Sure, it shows then in the URL, but so what? It will be the same message in the query string that they will then see in the popon. But you could, again, use a <form> post or a cookie. Or, if both pages are PHP page, use a session variable.
    Last edited by Old Pedant; 07-09-2013 at 01:28 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  4. #34
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    plus as soon as i click the upload button i get a white page, no errors, nothing in the FF controller tool, nothing.. So the upload must cause a new page document somehow..

  5. #35
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    I don't think I believe that.

    Show the code for your upload page. The receiver, that is.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  6. #36
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    not current
    Last edited by durangod; 07-10-2013 at 06:12 AM.

  7. #37
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    And why in the world would you *EXPECT* anything but a blank white page????

    That PHP code never writes anything to the browser except the JavaScript code!!

    Are you thinking that for some magic reason the browser will create its own HTML? Never happen.

    To top it all off, the JavaScript code is guaranteed to cause an error if it's actually executed, because you are doing
    Code:
    document.getElementById('showmsg').innerHTML=comb;
    but no place on that page is there any element with id="showmsg" !!

    *********

    I *HAVE* to ask: WHAT is the URL of the http_referrer, *in reality*? Is that referrer a page created via PHP? Or is it just an HTML page? (I don't care what the actual URL is, if you are using url rewriting, but how is it served up on your web server: from PHP code or not?).
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  8. #38
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    no sir of course i have html, as i said the html is posted in the admin panel under add page, remember i said it was like a textarea that accepts html,
    here is the html


    so i do have all the pieces, and yes i know the php does not do anything but perform the upload and set message and set the redirect, thats what its suppose to do sir.

    showmsg is here in the html. The reason all i sent you was the php code and the js is because i explained that i had an empty span and it was not filling in the span, and so thought you would know what an empty span was, sorry i didnt send it to you at first sir

    Since this html is run thru the script admin add page, the header and footer and all that is parsed but you dont see it other than the page source.

    it is not part of the site (as a plugin would be) so the rewrites or script dont really affect it other than i had to add the dir to my rewrite just for access thats all. So other than the iframe and the html, it is all outside the script.

    as a matter of fact when i did the demo all i did was make a full index html out of the html you see and fired it up. and here is that demo all exclusive on its own.. www.anorexiadating.com/mp3demo/ which still needs to be redone to get rid of the alerts, but on the site the alerts are gone


    what should happen just like my other scripts is that the php file has no output other than the span and so the user should never leave the page they are on other than for the refresh. that is what i thought would happen with this, the php file should execute in the background which is why when it changed to a white page i thought maybe there might be some output somewhere that should not be.

    i thought something was curious from the very start even with the alerts, on my other scripts when i use the alerts i never leave the page they all show up right there on the same page and also so does the js when i fill in a div msg or use span it shows up right away, no white page on my other stuff. so when i saw this white background i thought something was wierd.
    Last edited by durangod; 07-10-2013 at 06:13 AM.

  9. #39
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Well, I am totally lost.

    That HTML looks like the code for the page where the user is allowed to SPECIFY the upload file.

    But then, when the user clicks on that <input type=submit>, that code POSTs to the file (as specified in the <form action="...">) /mymp3player/audio_admin.php.

    And I thought that the PHP code you showed in post #36 was, indeed, the code for audio_admin.php. Are you saying that the page posts TO ITSELF???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  10. #40
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    both of those are current code.

    iframe just displays the player (different process totally isolated to itself)

    then the html form posts to audio admin

    audio admin should take the post, do the upload and/or create a message either way pass fail.

    then it feeds that message to the js and the js should put that data thru innerHTML inside the span.

    the problem is i do not know why the audio admin is not running silently in the background, maybe Fou Lu has an answer for that, i know that the upload is very picky at times and with no real error control even if it works it might be doing something i dont know about.

    Why is it creating a page, its not the script because i went over to the demo and same white page. so i went over to my other script that i built years ago and looked at the upload, it is pretty much the same upload code but it runs silent, never leaves the page i am on and just gives me a pass fail in an alert (which i will fix) but it never leaves the page when i click upload.

    Unless somehow i have some kind of hidden code in here i do not know why i get the white page when i click upload, what should happen is that the site tab should start to spin but the page should remain static just like my other script.

    Maybe i should get a clean page and retype the code just to be sure.. you think thats worth a try?

  11. #41
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    and i did just notice that in the html in 2 places i did this color#FFFFFF and i missed the : so that has just been fixed..

  12. #42
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    i think i got it, i removed the div

    <div style="font-size:small;color:#FFFFFF;">

    around the form and now it stays on the same page so let me test it now...

  13. #43
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Well, you've totally lost me. So I hope it works.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  14. #44
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    I think what is happening is that the site is converting the div to page output. I did find another missing " in the first span and fixed that and i am getting very close, to test i added a blank div at the end of the html and again i get a white page so im sure it has to do with the div.

    also even with being on the same page i am not getting the js fill on the span... I will let you know what happens but i need to do some testing on this first..


 
Page 3 of 3 FirstFirst 123

Posting Permissions

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