Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by PFMaBiSmAd

  1. You cannot do anything through HTML/CSS/Javascript. The file browse dialog box is not part of the web page, it is part of the Browser's GUI. You cannot set the value parameter or even the list of files that are displayed using a HTML type="file" input field.

     

    You can do some of these things using a flash upload form, such as specify which files are listed in the dialog box. Here is an example of a flash upload form - http://swfupload.mammon.se/

     

    The best you can do in HTML is style the browse button by putting the input field in a non-visible <div> and putting your own representation of a button in the same location.

  2. If you have tried to use both sessions and cookies and they both don't work, it is highly likely that your code is outputting content to the browser prior to the session_start() or the setcookie(). Either check your web server log for errors and/or turn on full php error reporting. Also, posting your actual code would help in allowing someone to see what you are actually doing in it.

  3. The error message indicates that output was started on line 1 [b]<?php[/b] I am guessing that you are FTP'ing these files to where they are being executed? A number of times, non-displayable language setting characters exist at the beginning of text files.

    Make sure that you are FTP'ing in ASCII mode and not BINARY mode.

    Also, make a new empty file using your program editor and copy/past the contents of the problem file into the new file.
  4. You need to post the code for the file that this error is occurring in to get specific help, but most likely, you are using session_register or register_globals are on and you have a global variable with the same name as a $_SESSION variable.
  5. Are you sure you are selecting one of the radio buttons?

    I tested your code using my generic form submission/display code.

    No radio button selected, gives this -
    [code]POST data -
    Key: submit, Value: Vote!

    GET data -
    Key: poll_num, Value: 1[/code]

    Selecting the first button, gives this -
    [code]POST data -
    Key: 1, Value: Me
    Key: submit, Value: Vote!

    GET data -
    Key: poll_num, Value: 1[/code]
  6. Sounds like a register_globals problem. See the following from the php manual -
    [quote]If register_globals is enabled, then the global variables and the $_SESSION entries will automatically reference the same values which were registered in the prior session instance. However, if the variable is registered by $_SESSION then the global variable is available since the next request. [/quote]
  7. simcoweb's correction will solve the parse error (the original line of code had one double-quote after the last variable.)

    Because of the misplaced ; after the echo line in the post, I suspect that your code has a [b]"< br / >"[/b] (without the spaces) but that the final double-quote on this is missing. This < br / > caused the newline in the post because the code was not enclosed in [ CODE ] tags. Posting this in [ CODE ] tags also would have helped find the problem as the color highlighting would have pointed out the missing quote.

    The next problem, as kenrbnsn pointed out, would be the missing quotes in the printf(...) statement.

  8. If I am reading the header info correctly, your sending mail server's IP address is 72.249.34.34 when a script sends through the mail() function (I am guessing this is on Unix and uses sendmail so that the mail server and your web site share a common IP address.) I checked this IP address at www.dnsstuff.com to see if it appears on any spam databases and it appears on three. This could affect how hotmail treats mail sent to it through your script.

    When you send mail yourself using a mail client/web interface, this probably goes through your host's main SMTP mail server.
  9. The only information that would be available to a PHP script are browser settings. These are about the only two that contain language setting information -
    [quote]$_SERVER['HTTP_ACCEPT_CHARSET']
    Contents of the Accept-Charset: header from the current request, if there is one. Example: 'iso-8859-1,*,utf-8'.

    $_SERVER['HTTP_ACCEPT_LANGUAGE']
    Contents of the Accept-Language: header from the current request, if there is one. Example: 'en'. [/quote]
  10. The amount of your code that you posted does not give enough information about what might be going on (you won't believe the number of times on Forums where some code was left out as being irrelevant to the problem which was actually where the problem was.)

    Since you are already using $_SESSION variables, changing register_globals should have had no effect on the function of sessions, but it may have had an effect on other code involved (such as generating the random value and setting the session variable.) We cannot tell this until we can see the actual code.

    Also, add the following line after your first opening <?php tag -
    [code]error_reporting(E_ALL);[/code]
  11. Have you checked your server log and/or put the following line in after your first opening <?php tag -
    [code]error_reporting(E_ALL);[/code]
    What are all the session related settings from your php.ini file?

    When you say that they don't work, what are they doing and post some code that you have that does not work.

    I suspect that output buffering is ON on the servers that your code works on and it is off on your development system and that your code is improperly outputting content to the browser prior to your session_start()...
  12. You need to use the in_array(...) function to test if a value is in an array of values.

    As soon as you ban the IP they are using they will find another one to use.

    You need to close the loop hole in your site that allows the SPAMMING to occur.
  13. The include(...) section in the manual mentions a restriction -
    [quote]If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory[/quote]This is the problem you are currently having where you must change the working directory.

    The key to using the include_path would be to just include using the bare file name and let it search the path. Give this a try with a couple of your files.

    Also, MCP mentioned a leading / refering to the root (of your web site in the case of building URL's). I have not tried this, but doing - include("/includes/init.php"); (assuming that there is a folder "includes" in the root of your web site) should always reference the same file no matter where it is being included.
  14. You can set a search-able include_path (similar to the Dos/Windows PATH) using the set_include_path(...) function - http://www.php.net/manual/en/function.set-include-path.php

    Using this you can set the include_path to be the current folder and any folders where you typically place your include files, then the include/require statements will search in these folders to find the include/require file.
  15. If you modify the behavior of the sessions (through the garbage collection settings) to cause sessions to be deleted after a short time for the purpose of limiting login time, it will affect all of the sessions that you are using and if this is on shared hosting, it will (depending on if the session files share a common folder) affect the sessions of the other users.

    It would be much better to store a timestamp in the session when login occurs and then on any operation (page refresh, submit form, navigate to new page...), check how long ago login occurred and take appropriate action.
  16. You are echoing content to the browser within your code while you are trying to modify the session.

    Try putting the following line in after your first opening <?php tag and see what you get -
    [code]error_reporting(E_ALL);[/code]
    Edit: There is also a note in the session_destroy section of the manual that session id must also be unset. This implies that session_destroy only destroys the session data while retaining the id. Your since your code is echoing content to the browser, the second session_start is not doing anything.
×
×
  • 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.