Jump to content

garygas

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Posts posted by garygas

  1. I do not think the following is not needed

    1987:             if (!get_magic_quotes_gpc()) {
    1988:                 $return = addslashes( $return );
    1989:             }

     

    Seems out of place to me, definitely take it up with Mambos dev team.

     

    wildteen.....quality!! Just removed the lines and cleaned up the error. THANK YOU!! :)

  2. Does the error tell you the file that produces that error and the line number? If so, can you post the code here?

     

    \htdocs\includes\mambo.php on line 1988

    ::) Could you post the code here? :)

     

    I was supposed to do that but lost myself for a second...I suppose thats what happens when you try to do a million things at once! :)

     

    
    1970: /**
    1971: * Utility function to return a value from a named array or a specified default
    1972: */
    1973: define( "_MOS_NOTRIM", 0x0001 );
    1974: define( "_MOS_ALLOWHTML", 0x0002 );
    1975: define( "_MOS_ALLOWRAW", 0x0004 );
    1976: function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
    1977: 	if (isset( $arr[$name] )) {
    1978: 		if (is_array($arr[$name])) foreach ($arr[$name] as $key=>$element) mosGetParam ($arr[$name], $key, $def, $mask);
    1979: 		else {
    1980: 			if (!($mask&_MOS_NOTRIM)) $arr[$name] = trim( $arr[$name] );
    1981: 			if (!is_numeric( $arr[$name] )) {
    1982: 				if (!($mask&_MOS_ALLOWHTML)) $arr[$name] = strip_tags( $arr[$name] );
    1983: 				if (!($mask&_MOS_ALLOWRAW)) {
    1984: 					if (is_numeric($def)) $arr[$name] = intval($arr[$name]);
    1985: 				}
    1986: 			}
    1987: 			if (!get_magic_quotes_gpc()) {
    1988:                 $return = addslashes( $return );
    1989:             }
    1990: 		}
    1991: 		return $arr[$name];
    1992: 	} else {
    1993: 		return $def;
    1994: 	}
    1995: }
    
    

     

     

     

  3. I seem to be getting this strange code at the top of my PHP pages on my site.

     

    Does anyone know what it could be?

     

    Source view of the top of the PHP page...

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    
    <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <meta http-equiv="cache-control" content="no-cache" />
      <meta http-equiv="expires" content="3600" />
      <meta name="revisit-after" content="2 days" />
      <meta name="robots" content="index,follow" />
      <meta name="publisher" content="Published by Scooters Ltd" />
    
      <meta name="copyright" content="..." />
      <meta name="author" content="..." />
      <meta name="distribution" content="global" />
      <meta name="description" content="Your page description here ..." />
      <meta name="keywords" content="Your keywords, keywords, keywords, here ..." />
        <link rel="stylesheet" type="text/css" media="screen,projection,print" href="/resources/css/scooters_setup.css" />
      <link rel="stylesheet" type="text/css" media="screen,projection,print" href="/resources/css/scooters_text.css" />
      <link rel="stylesheet" type="text/css" media="screen,projection,print" href="/resources/slimbox/css/slimbox.css" />
    <script type="text/javascript" src="/resources/slimbox/js/mootools.js"></script>
    
    <script type="text/javascript" src="/resources/slimbox/js/slimbox.js"></script> 
    <link rel="icon" type="image/x-icon" href="/resources/img/favicon.ico" />
      <title>...</title>
    </head>
    
    <body>

     

    However there is no '' in the original PHP page.

     

    Any help would be appreciated as I am completely baffled by this one!!

  4. How about:

     

    include('file://include1.php');

     

    And why would you use a Windows server?  Linux is where it's at. :D  And no one in their right mind would turn on register_globals, why'd you ask?

     

    include('file://include1.php'); doesn't work either!

     

    Windows...who knows why?? Been like that for 3-4 yrs! I wanted to turn register_globals on when I was installing osCommerce.

  5. I know what he'll reply with, his host disabled this because it's not secure.

     

    If the file is on your site, use a relative path.  If the file is on another site, use CURL.

     

    I have that feeling as well...thats what I got told when I asked about turning 'register_globals' on!

     

    CURL...?? Looking at their support pages, isn't this just for Linux?

     

    BTW... I am on a Windows Server

  6. Well I have logged a support ticket, so we will wait and see what they say.

     

    In the mean time they sent this out a week or so ago, before they started the upgrade to PHP5. Not sure if it indicated which direction they are going...

     

    Upgrading from PHP4 to PHP5

    PHP5 has been designed to be as backwards compatable as possible with PHP4, most website will require no changes to make them compatible with PHP5 which has many features not available on earlier versions of PHP, however there are a few differences that you should be awaire of when upgrading to this version.

     

    Reserved Keywords

     

    The following keywords are now reserved: final, php user filer, interface, implements, public, private, protected, abstract, clone, try, catch, throw and this.

    The following keywords are no longer reserved: cfunction, and old function.

     

    A full list of reserved keywords can be found in the PHP manual at http://www.php.net/manual/en/reserved.php#reserved.keywords.

     

    Case sensitivity

     

    The values of __CLASS__, __METHOD__, and __FUNCTION__ and classes/methods of get_class(), get_parent_class() and get_class_methods() are now returned as declared, this may lead to problems in older scripts that rely on a lowercase value.

     

    Other changes

     

    array_merge() will now accept only arrays. If a non-array variable is passed, a E_WARNING will be thrown for every such parameter.

    The Illegal use of string offsets causes an E_ERROR rather than an E_WARNING.

    strrpos() and strripos() now use the entire string as a needle.

    The T_ML_COMMENT constant is no longer defined by the Tokenizer extension. If error_reporting is set to E_ALL, PHP will generate a notice.

     

    $_SERVER should be populated with argc and argv if variables_order includes "S".

    An object with no properties is no longer considered "empty".

    ip2long() now returns FALSE when an invalid IP address is passed as argument to the function, rather than -1.

    If there are functions defined in the included file, they can be used in the main file independent if they are before return() or after. If the file is included twice, PHP 5 issues fatal error because functions were already declared.

    register_globals has now been turned off on all Linux servers.

     

    External documents

     

    Full documentation on backward incompatibility changes can be found in the PHP manual at: http://www.php.net/manual/en/migration5.incompatible.php

     

    Further information on migrating from PHP4 to PHP5 can be found at http://www.php.net/manual/en/migration5.php

     

    The complete PHP5 manual is available at http://www.php.net/manual/en/index.php

  7. Can you not use

     

    include('include1.php')

     

    ?

     

    Nope...returns this error...

     

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in E:\domains\m\mydomain.com\user\htdocs\index.php on line 13

     

    Warning: include(http://www.mydomain.com/include1.php) [function.include]: failed to open stream: no suitable wrapper could be found in E:\domains\m\mydomain.com\user\htdocs\index.php on line 13

     

    Warning: include() [function.include]: Failed opening 'http://www.mydomain.com/include1.php' for inclusion (include_path='.;C:\php5\pear') in E:\domains\m\mydomain.com\user\htdocs\index.php on line 13

  8. THey probably have the url SSI disabled.. thats what happened to me.. check the PHP.INI

     

    Cheers, I am looking at it now...a little lost?? What exactly am I looking for??

     

    Also I have just noticed this....

     

    include_path - .;C:\php5\pear

     

    If that means anything? ???

  9. Hey!

     

    First of all let me mention that I am only a beginner when it comes to PHP, however I know a little.

     

    I have been using, until recently, the following code to include files...

     

    <?php
    include('http://www.mydomain.com/include1.php')
    ?>

     

    This worked fine until my host upgraded it's server to v.5.2.6.

     

    Now the only way around I have managed to find is to use...

     

    <?php
    include(realpath('E:\domains\m\mydomain.com\user\htdocs\include1.php'))
    ?>

     

    I have tried require() and include_once() and everything returns errors, other than include(realpath).

     

    I only use the include to bring in footers, headers, menus etc and it is not used to connect with any databased.

     

    Can anyone suggest a way that I can use the include without using the realpath??

     

    Thanks,

     

    Gary

  10. Hi Guys!

    I am having some trouble with an upload script. I think its correct but who knows, cos it does not seem to work.

    I created a simple HTML page with the whole upload features on it (code below)

    [quote]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Upload Form</title>
    </head>
    <body>
    <form action="do_upload.php" enctype="multipart/form-data" method="post">
    <input type="hidden" name="MAX_FILE_SIZE" value="51200" />
    <p><strong>File to Upload:</strong><input type="file" name="fileupload" /></p>
    <p><input type="submit" value="Upload!" /></p>
    </form>
    </body>
    </html>
    [/quote]

    Than I created the do_upload.php as refered to in the above script. (below)

    [quote]<?php
    $file_dir = "\fileuploader";
    foreach($_FILES as $file_name => $file_array) {
    echo "path: ".$file_array['tmp_name']."<br />\n";
    echo "name: ".$file_array['name']."<br />\n";
    echo "type: ".$file_array['type']."<br />\n";
    echo "size: ".$file_array['size']."<br />\n";

    if (is_uploaded_file($file_array['tmp_name'])) {
    move_uploaded_file($file_array['tmp_name'],
    "$file_dir/$file_array[name]") or dir ("Couldn't copy");
    echo "file was moved!<br /><br />;
    }
    }
    ?>[/quote]

    But when I load it onto my webserver, and run it, I get the error:

    [quote]Parse error: parse error, unexpected $end in e:\domains\g\garygasonline.co.uk\user\htdocs\test_server\file_uploads\do_upload.php on line 15[/quote]

    Anyone got any ideas as to what is wrong?

    Thanks,

    Gary
  11. [quote author=realjumper link=topic=109292.msg440472#msg440472 date=1159130027]
    I don't understand what you mean 'my sendmail_from' is locked'. Perhaps you could explain or post your code?
    [/quote]

    Sorry it appears that I didn't hit the nail on the head.

    I think I need to change my sendmail_from section of my php.ini file in order to use any PHP mail applications, but wondered if there was a way around it, being I do not have access to the php.ini file.

    Thanks,

    Gary
  12. Hi Guys 'n Gals!

    I'm new to this whole PHP world (in fact I only started really looking at it yesterday), but I've already come to a hitch.

    I've been following a article in Sams Teach Yourself PHP book on how to create a form that is filled in by a visitor and is e-mailed directly to me.

    The problem I have is, I am hosted by Streamline.net and have PHP/MySQL active, but my 'sendmail_from' (which I think I have to edit) is locked and I have been told by Streamline.net that I cannot edit it due to security.

    Is there a way around this, or should I try looking for a new host?

    Please help!

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