Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by vba

  1. Will need to investigate whether register globals are turned on in the Unix box - thanks



    Sounds like register globals may be turned on on the Unix box. If so, be sure to research the security implications of running with register globals enabled if you don't know. I believe register globals is being removed from PHP6 due to the number of security exploits it allowed.
  2. Well,


    the $_SESSION['new_array'] that we are utilising has the potential to store an array of up to 30 primary elements as well as each element being an array of 6 sub elements ( 2 x floats(4,2), 2 x tinyint(1), 1 x int(11) & 1 x varchar(5)). An aray of arrays. However, it is typically only going to have up to a max of 5 primary elements being updated at any time. By the way, we tried it with all 30 being updated and it worked quite well.


    To fault find we placed print_r($_SESSION['new_array']) & print_r($new_array) statements everywhere to isolate where the array was being emptied. Basically when we used $new_array = array(), it emptied $_SESSION['new_array']. Just that "1 line of code" stopped us!


    Our windows dev is slightly behind the unix prod environment - MySQL v5.0.51b (5.0.81), PHP v 5.2.6 (5.2.9).



    That seems very very odd indeed. I cannot see why Unix would reset a session variable because it has the same name as a local variable.


    How big is the array being stored in session? If I ever store arrays in session which I dont have to do very often I usually serialize them first too:



    $_SESSION['new_array'] = serialize($whatever_array);



    Then when you want to retrieve that array from session:


    $diff_array = unserialize($_SESSION['new_array']);




    I have to say I have never experienced an issue with $_SESSION variables being overwritten though. Very odd. I can't see a reason why that would possibly happen, but I am glad you got it working!

  3. Well problem solved.


    Ended up being just before the update.


    I was assigning a session variable(array) to a variable(array). This normally works however there was a small problem which windows lets you get away with and unix does not.


    //set the new array as type array

    $new_array = array();

    //assign the session array to the new array

    $new_array = $_SESSION['new_array'];


    The problem with this is the names, they are both called new_array. Windows recognises them as different and unix does not.


    Basically the first command to set the new array as type array empties the session array under unix.


    Once I changed the $new_array to $diff_array it all works fine under unix and windows.


    So it is all :) now.

  4. Can we use InnoDB for the schemas and also the engine. I read something about SET storage_engine = InnoDB for a session however cannot find the PHP method of doing so. However I could be barking up the wrong tree on needing the storage engine set to InnoDB to get the writing happening.


    I can read all I want, just cannot write. :)

  5. Hi OJB, Yes you are correct "Schema" just using wrong terminology but right item.


    Well I have still been looking at this and I have added in enough "Try/catch" to make the code twice as long and made sure that I can make them all fail on the Windows system but still no failures on the Production system. I did notice that the default of MyISAM had been set by the MySQL server on all the tables and have change them all to InnoDB. But still without success. The storage engine of the MYSQL server is set to MyISAM, but I cannot change that as it is set by TCH(so hopefully I should not have to and changing the tables should be enough).


    Any ideas?






    You might not be seeing any visual failings because you aren't catching your exception and dealing with it....


    you need a try and catch i think.. like so:



    $result = new mysqli("localhost", "username", "password", "table");
    	$text = 'Could not connect to database server [W-m]';
    	throw new Exception($text);
    catch(Exception $e)


    plus shouldn't it be 'schema' not 'table' in the mysqli construct?

  6. Hi,


    I am using the standard Update command as per below:


    $conn = db_conn_Write();


    $myQuery = "update vb_products

    set price = '".$pr1."',

    active = '".$cb1."',

    specialprice = '".$pr2."',

    specialactive = '".$cb2."',

    uom = '".$uom."'

    where vb_prod_id = '".$vb_prod_id."'";


    $result = $conn->query($myQuery);


    Below here is the connection function for the database:


    function db_conn_Write() {


    $result = new mysqli("localhost", "username", "password", "table");


    if (mysqli_connect_error()) {

    $text = 'Could not connect to database server [W-m]';

    throw new Exception($text);


    } else {

    return $result;




    This all works fine on my windows development site at home (same versions of PHP and MYSQL), however when I ftp the files to the production environment, all the screens work fine the only failure (no visual error messages) is the actual update to the database.


    When running the update command as listed in PHPMyAdmin the data updates.


    Any clues would be much appreciated.



  7. I am always amazed at how the simple things give the most trouble. I had in previous attempts changed the port to 21 but had other things wrong. Now I forgot the port ;)


    Thanks for your help. ;)


    Please change the port to the default 21 from 2121 and check it out again. If the issue persists, kindly open a support ticket using the Help Desk link (given on the top menu and in my signature), we will check it out and get back to you.
  8. Hi, Below is the messages I am getting from Filezilla when attempting to connect to the server. Site and IP changed.


    Can anyone offer some advice on what might be the problem. I am entering in "site.com, username, password and 2121" as the port. The correct IP resolves however no connection occurs. I am using the main account that is there by default in the ftp accounts page.


    20:19:35 Status: Resolving IP-Address for site.com

    20:19:35 Trace: ControlSocket.cpp(1057): CRealControlSocket::ContinueConnect(0p1531e38) m_pEngine=0p147e9c8 caller=0p152ebb0

    20:19:35 Status: Connecting to 208.??.??.?:2121...

    20:19:56 Error: Connection timed out

    20:19:56 Trace: CFtpControlSocket::ResetOperation(2114)

    20:19:56 Trace: CControlSocket::ResetOperation(2114)

    20:19:56 Error: Could not connect to server

    20:19:56 Status: Waiting to retry...

    20:20:01 Status: Resolving IP-Address for site.com

    20:20:01 Trace: ControlSocket.cpp(1057): CRealControlSocket::ContinueConnect(0p150d618) m_pEngine=0p147e9c8 caller=0p152ebb0

    20:20:01 Status: Connecting to 208.??.??.?:2121...

    20:20:22 Trace: CRealControlSocket::OnClose()

    20:20:22 Trace: CFtpControlSocket::ResetOperation(66)

    20:20:22 Trace: CControlSocket::ResetOperation(66)

    20:20:22 Error: Could not connect to server


    Thanks for your support. ;)

  9. Hi All,


    I have worked it out.


    The validation I was doing on the initial load of the primary page was failing.


    This then stopped some code from running and thus all my links were not working.


    The strange thing was that my test server at home (unfortunately windows based) did not exhibit this error as the validation was getting the right information.


    Due to this being a unix based hosting there is a minor difference in how it handles pages on first load eg the data was different to what windows on first load does.


    All fixed now. :)



  10. Hi,


    I uploaded new pages last night into both the public_html and public_html/pages folders.


    I then happily clicked around and saw that everything was working fine.


    Now today I have gone to my home page and it is ok however when I try to go to any other pages which are located in "pages" I get 404 error. The home page uses 3 other pages in the "pages" directory to build itself so it can access the files to build but people cannot see the sub pages?


    If I log into Cpanel and then start FileManager I can then access the pages. Cpanel on its own does not work.


    Help please.



  11. Ok, then thats where I would start looking. The IP's you posted belong to Trend Micro in Japan and if they are trying to access your cPanel its probably one of their Applications you have running. Its probably checking the web sites you visit to see if they are safe. To test it out Access your cPanel two or three times and make note of the exact times you go there, then compare the times with your logs and see if those IP's are there around the same time.


    If this is what is happening I wouldn't worry about it. Or if you want find the program or area in Trend Micro and see if you can turn it off. I personally would just leave it alone and ignore the hits from those IP's, they are only doing it for your own security :)


    Hi Madmanmcp,


    Thanks for the info, we had noticed that it was coming in around the same time as we do, however not everytime and sometimes when we haven't been there.


    So thought we would raise it as a question. Looks like it is probably Trends own bots checking to see if our site is a dangerous site.


    Thanks again for the help.



  12. Hi I am new to Web hosting and new to the TotalChoice Family.


    I have 2 IP's that are accessing /cpanel that are not mine. I have tried blocking the individual IPs and also the range using IP Deny Manager.


    The IPs are and, they keep appearing in the Latest Visitors list. The IPs are registered to Japan.


    Can anyone advise on this?



  • Create New...