Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Posts posted by GingerRobot

  1. I'm using 3 frames, how do I target another frame using include(example1.php)?

     

    What are you trying to achieve? You want to (re)load a page in one frame, during which another frame's content is changed via a PHP include? You can't do that. I *guess* you could reload the page that defines the frameset with some parameters passed in the URL, but that's pretty messy (plus it requires all the frames to be re-loaded). Alternatively, you could use some javascript. Maybe if you explain what it is you're trying to do, we could suggest a better method.

  2. well for example how do i go about not showing this..

     

    [*img]http://www.google.com[/img]"

     

    currently its trying to actually show the page as an image... (showing a failed image icon) but if this page was a .php page they could easily do pretty much anything they wanted.

     

    i mean i just now tried it on this forum and it doesnt allow it.

     

    Two things...firstly, you would get a "failed" image icon if you do this kind of thing; what you're displaying isn't a valid image so it can't be displayed.

     

    Second, you'd need to change the extension of the php file to, say, .png and then configure your webserver to parse files with the extension .png as php files.

  3. Well if you just wanted to check the extension you could use strrpos to find the last occurence of a '.' and then use substr to check what comes after the dot for valid extensions.

     

    However, if you want to ensure it's actually an image, you're best bet would probably be to try and open it using the GD library. Otherwise, someone could fake an extension and have some php code running on your site, for example.

  4. i mean sub-categories in php. php helping completely very active forum thus some interesting topics can be missed out. categorizing shall help to solve this problem.

     

    It's been tried in the past. We used to have a dedicated OO PHP board, for example. It was dropped for various reasons, including the fact that people regularly posted in the wrong place. In any case, unless there was demand for a board of this nature (and my demand, I mean a number of posts fitting into that category) it'd seem a touch pointless creating one.

  5. As the manual page says, this 'flavour' of regular-expression (pattern matching) functions have been depreciated in favour of the PCRE ones (see here) as of PHP version 5.3.

     

    Of course, if you're using a third party script, you may wish to simply turn off the display of E_DEPRECIATED notices using the display_errors function or changing the value in php.ini. However, you might be wise to find an alternative to this script; it is obviously out-dated if it is relying on depreciated elements, so who knows what other problems exist. Further, the functions that are currently depreciated will be removed in PHP 6, so the 'solution' isn't a long-term one.

  6. This means there is a problem with your query and mysql_query() has returned false. You should add some debugging code to your call to mysql_query():

     

    $result = mysql_query($sql) or trigger_error(mysql_error() . "<br> Query was: " . $sql , E_USER_ERROR);
    

  7. If you have a syntax error and PHP can't parse the page, then setting the error_reporting level and turning on the displaying of errors at runtime will have no effect. See the comments on my tutorial:http://www.phpfreaks.com/tutorial/debugging-a-beginners-guide

  8. I was thinking something like when the user posts a comment it would put a 0 into the database and when you load the page up it would go to 1, I was thinking that but what if there was 2 new comments ? What would be the best way to do this??

     

    It's effectively a simple, one-way PM system, right? You want to send "messages" to a user when something happens and have them be notified of these "messages" until they've read them.

×
×
  • 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.