Jump to content

StormTheGates

Members
  • Posts

    170
  • Joined

  • Last visited

Posts posted by StormTheGates

  1. I am having a very odd error that Ive never encountered before. Here is the situation:

     

    I have a database table that gets echoed out in rows in a table, with checkboxes for each user.  Everything works fine with only a few users, the entire thing runs normally.

     

    However, at exactly the 250th checkbox the form stops POSTing data. For example, given this code snippet:

    <?php
    $people = $_POST['change'];
    var_dump($people);
    ?>
    
    
    
    

    $people will only ever contain the first 249 checkboxes selected, even if all 400some are. 

     

    Does anyone have any idea why this could be, or if there is some type of memory limit I should check? My memory_limit is 512mb and max post size is 500mb

  2. How can I get the page to be processed without lynx?

     

    Lynx was asking for permissions earlier for cookies, I told it to always accept. The code is a very simple:

     

    $ourFileName = "export.csv";
    $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
    fwrite($ourFileHandle, "all data");
    fclose($ourFileHandle);
    

     

    Cronjob setup is:

     

    45 9 * * * lynx "site" > /opt/websites/wut.log

     

    But Ive also tried using a visit.sh shell script that did the following:

     

    lynx --dump "site"

     

    Same result from both.

     

     

     

  3. Hey all, having a very odd problem this morning.

     

    I have a cron job that executes a script that performs the following action:

     

    "lynx --dump "php page""

     

    This executes fine, I see all the output. The problem is this:

     

    The php file is supposed to write information to a file. When executed by a user on a web browser like Chrome or Firefox, the data is written to the file with no problem. However with lynx the file is created with size 0, and no data is ever written.

     

    Any ideas why this may be?

     

    Thanks.

  4. Aye thanks for that. I discovered it during an attempted tracert.

     

    As it turned out in the end spam filters were activating because of a URL in the email, one that wasnt https for some reason. Also it seemed like the header that said "reply to:" was causing spam filters to activate as well.

     

    Solved :D

  5. Hey all, having a very odd problem Ive never encountered.

     

    I am trying to send mails via PHP's built in mail function. I set the From and Reply-To like so:

     

    <?php
    $headers = "From: noreply@contractortraining.energy.gov\r\n";
    $headers .= "Reply-To: noreply@contractortraining.energy.gov\r\n";
    

     

    Now here is when things get weird. When this email sends the return email gets changed to noreply@doe.golearnportal.org. Oddly enough it only happens when the From is "contractortraining.energy.gov". For example:

     

    If I send with these headers the email comes in as doe.golearnportal.org

     

    However if I change the headers to be something like "sometest.org" or "nowhere.golearnportal.org" or anything other than "contractortraining.energy.gov" it will come through using the specified headers. It is only when I use "contractortraining.energy.gov" that the headers get changed.

     

    Any ideas what could be responsible for this type of behavior? I dont think its a PHP issue at the moment, and this code is working successfully on several other servers.

  6. Have you tried changing to something like this? Just to see of course.

     

    if($Log['Revision1']&$Log['Revision2']){
         $Message = 'Updated $Log[Name] from revision: $Log[Revision1] to revision: $Log[Revision2]';
    }else{
         $Message = 'Freshly downloaded: $Log[Name] revision: $Log[Revision1]';
    }
    

     

    Also try putting a space at the end of $Message. Like so:

     

    $Message = 'Updated $Log[Name] from revision: $Log[Revision1] to revision: $Log[Revision2] ';
    

     

    That way you will know if the random numbers are part of the Revision number or are appended to the string.

  7. Ummm. You can search and replace the tags to fix the problem forever in any piece of code.

     

    You assume that the government wants things functional and backwards compatible. The last time I mucked with their code they had a hissy fit. Trust me I know <? are bad tags, Ive seen benchmarks where the <?php is much faster. But sadly they are paying the bills so I just make our server run it.

  8. Well you helped me with my problem so I will toss a few ideas at you.

     

    Have you tried print_r, just to see if the numbers are inside any of the array elements?

     

    Also array_merge will merge strings of the same sequence, I think, but not numbers, could this be causing extra numbers to be appended?

     

    Also maybe print one thing out at a time to see where the 50 is coming from?

     

    Sorry I am not much help just tossing some ideas out.

  9. Don't use the short open tags. It results in non-portable code because you won't always be on a server where you will have the ability to turn the setting on.

     

    You have probably already wasted 10x times more time messing with this on one server setup than you ever saved in typing time by leaving off three letters a few times on a page.

     

    If you simply use full opening tags, you won't ever need to waste any of your time messing with this problem when you put your code onto a different server. And if you ever expect to publish any of your code for others to use, you CANNOT use short open tags in it because the people using that code won't necessarily have the ability to turn on the setting on their server.

     

    Relax boss, I didnt exactly get a choice. The government hands me the code, I just make it run on our servers.

  10. Hey all, I have an odd problem that I hope someone here has had and knows how to fix.

     

    I recently installed Apache, PHP, and MySQL on a new server we have at work. Everything works fine, oddly enough, except for PHP parsing.

     

    You see the following code:

     

    <?
    echo "test";
    ?>
    

     

    Will display the PHP code, while

     

    <?php
    echo "test";
    ?>
    

     

    Will echo "test". The problem seems to be that PHP isnt parsing the <? directive as a start command. Does anyone have any idea why this might be?

     

    Thanks for any help.

  11. Aright here is my situation. I have an array of language strings loaded at the top of the page from a language file. Then later the string is called. Some of the strings have variables in them. For example here is a sample:

     

    <?php
    24 => "You have withdrawn $$with from that ATM account. There is $$amount left.",
    ?>
    

     

    And then later in the page it goes like this:

     

    <?php
    $amount -= $with;
    $money=$money + ($with*.;
    echo "$lang[24]";
    ?>
    

     

    However I encounter a problem here, the variables are blank. Any idea why or a way I can fix it?

  12. I recently moved a lot of my files to a new server. Now when the files are displayed there are weird rectangles in them. Like some characters can not be displayed. Is this a PHP problem? I am kind of at a loss of what to do.

  13. not sure this will help, but I do this with my scripts:

    in my config.inc.php (the configuration file. yours may be named something else, of course)

    <?php
    $language = "en_US"; //can be en_GB, l_SP, IT, etc.
    

    then in all my files, I have this:

    <?php
    include("config.inc.php");
    include($language."/lang_db.inc.php");
    

    and the lang_db.inc.php holds all the strings that I'll need translated.

     

    The language files in one page would be far to large to load on every page. I only need a select chunk at any given moment. Most of my pages look like this:

     

    <?php
    include 'languages/main.php';
    $lang = GetLang();
    
    echo "Statement: $lang[0]";
    ?>
    

     

    And on main.php

     

    <?php
    function GetLang(){
    
    $fr = array(
    0 => "seulement rapporter les bogues dans le jeu pour eux.",
    1 => "les modérateurs pour signaler des problèmes et des bugs à eux.",
    2 => "pour aider les bureaux. S’il vous plaît demander jeu des questions qui leur sont confiées. ",
    3 => "pour les personnes qui possèdent des casinos. ",
    4 => "patrons pour la famille.",
    5 => "la main droite pour les hommes.",
    6 => "pour vos amis en ligne. ",
    );
    
    $de = array(
    0 => "bericht nur bugs im spiel zu ihnen. ",
    1 => "moderatoren für probleme und bugs zu ihnen",
    2 => "für Help Desks. Bitte fragen sie spiel fragen zu ihnen. ",
    3 => "für Menschen, die eigenen Casinos. ",
    4 => "für Familie Bosse. ",
    5 => "rechte hand für männer.",
    6 => "für ihre online-freunde. ",
    );
    
    ...
    
    if($_SESSION['lang'] == 'en'){
    	return $en;
    } elseif($_SESSION['lang'] == 'fr'){
    	return $fr;
    } elseif($_SESSION['lang'] == 'de'){
    	return $de;
    } elseif($_SESSION['lang'] == 'it'){
    	return $it;
    } elseif($_SESSION['lang'] == 'sp'){
    	return $sp;
    } elseif($_SESSION['lang'] == 'nl'){
    	return $nl;
    } else {
    	return $en;
    }
    }
    ?>
    

  14. Here is my situation:

     

    I run a game that I am trying to make multi lingual. There is a language file for every regular file. On the language files there are arrays of all the strings for each language. For example users.lang.php contains 6 arrays of 8 strings each, an array for each language and then all the strings in that language.

     

    Now some of these pages are quite large, and have a lot of text 100-300 strings.

     

    Is there a way to cache these php pages so that the server dosnt have to go through all the arrays each time? The language files will not be changing so I was hoping I could find a way to cache them to make it faster to access.

     

    Any ideas?

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