Jump to content

Krash

Members
  • Posts

    83
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Krash's Achievements

Member

Member (2/5)

0

Reputation

  1. Tried using ftp:// wrapper, but get the same error - 'URL file-access is disabled in the server configuration'. I'm actually trying to do something that appears very simple, and been working on it on/off since beginning of the year. I'm building a verification widget that runs in an iframe on the SMF registration form. I'd like to keep it in the widget, so all users would be loading it off my server, but haven't found a good way to pass the verification code from the iframe to the SMF form handler. Session variables don't work, because the iframe and SMF are running different sessions. I can use a cookie locally, but it won't work on a user's forum because the cookie is set from the iframe (my domain), and must be read by the user's domain. The fallback is to write a verification code (0 or 1) to a text file, and have the SMF form handler open the file and read the code. This also works locally, but it requires either having the widget write the text file on the user's server, or allowing the user to read the file off my server. That's what I'm working on tonight - need a script that will run in the user's domain/server, and open/read/delete the file from my domain/server.
  2. Is it possible to allow a script running on another server to write/read a specific file on my server? I can set file permissions, but not having any luck with file paths due to php5 blocking http:// urls.
  3. Got it. Thanks for the responses.
  4. How would that work? The verification variable I need to pass is generated by php in the form handler, and there's nothing in the iframe html that would give me that.
  5. Actually, no, I'm not confused . I need a way to pass a variable from a verification widget running in an iframe on the SMF registration form to the SMF reg handler. The variable must be unique to each user, so multiple registrations don't step on each other. Every user runs a unique session, but $_SESSION variables don't work because the widget and SMF use different sessions, so the variable is lost. Cookies would work because they're client-side and unique to each user, but this problem with setting/retrieving the cookie value has me stumped. I'm currently using a workaround that has the widget write the value to a text file, and the reg handler reads it and deletes it. Works fine, and the file only exists for a few seconds, but if multiple users register simultaneously on a busy board, it'll cause a problem.
  6. I've tried every combination of parameters, and the only one that works is ('name', 'value'). If it's client dependent, then it's not really useable on a production site. Thanks.
  7. Um... yes, you'll see that's the first line in the read script in my previous post. It returns a null array - there are no cookies. I tried setting the cookie with javascript, and it works the same. The cookie will not set if there's an expiration parameter. The first line doesn't work, second one does - <html> <body> <script> document.cookie = "keyval=xyz; expires=Thu, 2 Aug 2021 20:47:11 UTC; path=/"; //document.cookie = "keyval=xyz;"; </script> </body> </html> Either the cookie is not being set, or it's expiring immediately, both in php and js.
  8. Ok, here's what I have: - The cookie does not set if I include the time() parameter. I allowed for the 60 min. difference between my local time and server time, didn't help. - The 'COOKIE set' is not there to confirm that the cookie is set, just to echo something so I know the script ran. - I tried the subdomain parameter '/' with no effect. - I'm using a separate script to display all cookies and the new cookie: <?php print_r($_COOKIE) . '<br>'; if (isset($_COOKIE['keyval'])) echo '<br><br> COOKIE = ' . $_COOKIE['keyval'] . '<br>'; else echo ' No COOKIE <br>'; ?> and it confirms that the cookies are deleted if I add the time() parameter to setcookie. I ran your script and it tells me cookie is set, but my read script doesn't find it unless I remove the time() parameter. I'm on a shared Apache server, Unix box, running php5.
  9. Just started tinkering with cookies - trying to pass a variable between scripts (can't use session variables), and am unable to retrieve cookie values that are saved by one script, and used by another. The cookie is saved and can be retrieved by a test script in the same browser session, but isn't available to a script running in a different session. I've tried to set the cookie using the time() parameter to prevent it from expiring at the end of the session, but it doesn't work. The ccokie will not set if there's a time() parameter, and an existing cookie is deleted if I try to set it again with time(). No clue why this is happening - tried it in three different browsers. This is the test script that sets the cookie successfully - <?php setcookie('keyval', '3'); echo 'COOKIE set'; ?> ...and this doesn't - <?php setcookie('keyval', '3', time()+3600); echo 'COOKIE set'; ?> - Why doesn't the time() parameter work? - Is it possible to retrieve a cookie value that is set in a different session? Thx.
  10. How to get this button to open page in new window - $buttons = array( 'help' => array( 'title' => $txt['help'], 'href' => $scripturl . '?action=help', 'show' => true, 'sub_buttons' => array( ), ),
  11. Why would you want to zip an mp3? The zip file will be the same size as the original - there's nothing to compress in an mp3.
  12. This appears similar to the problem you had in your previous thread. It's browser dependent, so it's probably caused by the html form code, not the php script. Post the html.
  13. What do you get when you echo $_SESSION['Coin Flip'] at the top of the script?
  14. Just a theory, but from my recent experience with a similar problem, and many previous problems with Firefox, I would guess that FF was unable to execute the crappy html in the <img> tags, which will cause it to behave unpredictably. In this case, it dumped the session id, which caused the session variables to disappear. If you run the original code in IE, it will probably work fine. IE is much more tolerant of sloppy code (believe me, I know). The table row that included the bad code is there just as a spacer between the lines that are displayed above and below it, and the empty <img> tags apparently were used to keep the table cell open. Some browsers will collapse an empty <tr><td> </td></tr>, and you'll lose the space between lines. It's a very bad way of doing something very simple.
  15. The line that's causing the problem serves no purpose - it may be there just as a spacer to keep the blank table cell open. Delete the line - if it causes the cell to collapse and screws up the formatting, put a &nbsp in it. Doesn't seem likely that line is affecting the session variables, but get rid of it and see what happens.
×
×
  • 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.