Jump to content

pendelton

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    UK

pendelton's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks. I worked out that it was a pre-defined constant that has been sneaked in between PHP 4 and PHP 5. What I was wondering was what its strange value means.
  2. The follownig code works as expected in PHP 4, but not as expected in PHP 5.1.2. I have just been baffled for hours wondering why the following code prints "262145" instead of the UK pound sign. [code] define(CURRENCY_SYMBOL, '£'); print CURRENCY_SYMBOL; [/code] Initially I thought that I had got my HTML code '£' mixed up. Then I eventually tried the following which also prints 262145. [code] define(CURRENCY_SYMBOL, 'hello'); print CURRENCY_SYMBOL; [/code] If I use CURRENCY_SYMBOL_1 for the define then everything works as expected. It seems that CURRENCY_SYMBOL must be defined in PHP's core somewhere and also their is no way to override its value (not that I want to now that I know what is going on). Can anyone tell me what CURRENCY_SYMBOL is, and why its value is 262145 (at least on my server with my local)?
  3. Some additional basic coding standards would help you find these problems much quicker. 1. Indent you nested latin braces (using tabs), e.g. [code] foreach ($_POST as $key => $value) {   $value = urlencode(stripslashes($value));   $req .= "&$key=$value"; } [/code] (see how the opening and closing braces now match up?) 2. Don't spread open quotes over mutiple lines, e.g. [code] $message = "Hello,\nCongratulations!\nYou have won auction ....\nBest Regards"; [/code] You will probably find that you are missing a quote ", a latin brace "}" or a beacket ")".
  4. Call me stupid, but what's a vav function?  ???
  5. I assume that the timezone on you machine is not central time US? If it is then you don't need the putenv. However, the server isn't using central US time you will need to write to code as follows: Use [code] <? putenv("TZ=US"); print date("h:i:s"); ?> [/code] Try the above then chage "TZ=US" to "TZ=GB" (TZ stands for timezone).
  6. Are you saying that you echo doesn't work when you output the content of a file? If so, don't forget that you are viewing it via HTML which will format the output (or at least probably get confused by some of your file format). Get your echo to echo's the file content that doesn't quite work then do view source on the page. You should find that it is all there in the source but isn't all displayed as you expect in the broweser.
  7. I am a little confused by your question. What exactly are you trying to acheive with this symbolic link? Is this a PHP question?
  8. date("h:i:s"); Use putenv("TZ=GB"); to set your timezone (you will need to replace GB with UST or similar).
  9. You will need to use fopen and fwrite - see the PHP manual. The folder that you want the files to be creating in will need to be writeable. This may be a security risk as it will allow anyone to write anything to this folder.
  10. Does the file already exist and is the file/folder on the server writeable? Also, try setting $done to a simple string like "hello" until you get things working.
  11. I have just had an idea. I don't think that your second server is interpreting the file as PHP, it's just displaying the code as HTML. I assume that you aren't missing the <? ?> around your code and you are using a sensible file name extension like ".php"? If so, you need to check your server setup to ensure that it is including PHP correctly and that the PHP file extensions are defined in the config files correctly.
  12. Can you provide the code for the complete file or at least several lines before and after the echo " My name is $var1. My favorite color is  $var2.";?
  13. Try $query = "UPDATE uploads SET shown = 'y', showing = 'y' WHERE file_name = '{$row[0]}'";
  14. You could use a callback function and multiple curl_exec if you don't want to use multi_init. E.g. $hCurl = curl_init(); curl_setopt($hCurl, CURLOPT_WRITEFUNCTION, 'TransactionResultCallback'); $Output = curl_exec($hCurl); $hCurl2 = curl_init(); curl_setopt($hCurl2, CURLOPT_WRITEFUNCTION, 'TransactionResultCallback2'); $Output = curl_exec($hCurl2); You will probably need to use a global variable to store the returned string in your callback functions.
  15. Have you tried using phpmyadmin to see what is going on?
×
×
  • 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.