Jump to content

abdul_zu

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

abdul_zu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All, I have a text file more than 200K. When i am using the following code it is not working. $fname = "http://localhost/dreportfiles/test.txt"; $file = fopen ($fname, "r"); if (!$file) { echo "<p>Unable to open remote file.\n"; exit; } while (!feof ($file)) { $line = fgets ($file, 1024); /* This only works if the title and its tags are on one line */ echo $line. "<br>"; } fclose($file); Here is the error i am getting : Please suggest me some fast way to read the file from remote. Regards,
  2. HI, How i can know if my PHP web application already connected to MySQL or Not? From this i will avoid lot of connection in my whole PHP application. I tired the following but it gives error: function connect() { $result = mysql_pconnect($GLOBALS['dbserver'], $GLOBALS['dbuser'], $GLOBALS['dbpws']); if (!$result) return false; if (!mysql_select_db($GLOBALS['dbname'])) return false; return $result; } Then i try to ping but i got error. if (!mysql_ping()){connect();} Warning: mysql_ping(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/auth.php on line 10 Please point to call only connect() function if there is not connection to mySQL?
  3. Cags, Thank you for your hint, i use the following and its working well...
  4. When i am using below code i am getting error. Warning: sprintf(): Too few arguments in /var/www/html/Cdr.php on line 120 Please help me to find where is the issue. $sql = "SELECT `id_call`,`id_client`, `ip_number`, `caller_id`, `called_number`, `call_start`, `route_type`, `id_tariff`, `cost`, `duration`, `tariff_prefix`, `client_type`, `pdd`, `costR1`, `costR2`, `costR3`, `id_reseller`, `tariffdesc`, `client_pdd`, `orig_call_id`, `term_call_id` from calls WHERE client_type = %s "; $sval = "mysql_real_escape_string($pc),"; if($number <> ""){$sql .= "AND called_number LIKE '%s' "; $sval .= "mysql_real_escape_string('$number%'),";} if($duration <> ""){$sql .= "AND duration $dc '%s' "; $sval .= "mysql_real_escape_string($duration),";} if($ip <> ""){$sql .= "AND ip_number LIKE '%s' "; $sval .= "mysql_real_escape_string('$ip%'),";} if($cid <> ""){$sql .= "AND caller_id LIKE '%s' "; $sval .= "mysql_real_escape_string('$cid%'),";} $sql .= " AND call_start >= '%s' AND call_start <= '%s'"; $sval .= "mysql_real_escape_string($fromdate),"; $sval .= "mysql_real_escape_string($enddate)"; $sva = "mysql_real_escape_string($number)"; //echo $sval; $tq = sprintf($sql,$sval); echo $tq;
  5. Hi All, I have the following string. i need to make two loop one will run for each ; and another will run under this first loop but with comma. $val = " 00->,01,011->,00->5554,8889,011->5554,9972,011->9972;00->,01,011->;00->,01,011->,00->5554,8889,011->5554,9972,011->9972;00->,01,011->"; Could you please help me to separating this string? Regards,
  6. I am sorry for this explanation. Here is once again i am trying if it will make some help for me. I have one filed in MySQL table called permissions. and in HTML page i have 11 check box which have the separate value for the 11 titles. <label> <input type="checkbox" name="checkbox" value="1" /> Active</label> <label> <input type="checkbox" name="checkbox" value="4" /> GW</label> Till 1024: rates to DNIS When this page will load i need to select the checkbox if its value already exits in permissions filed. The query for mysql is created and working well. I need to get proper value to select only appropriate checkbox. Thank You
  7. Hi all, I need to find a way for the following code. i have one variable his value is 2047 $val = 2047; and i have following numbers, and each numbers depend his own description. 1 : Active 4 : GW 8 : PC2Phone 16: Devices 128: All clinets 256: Booth 32: CallBack 64: IVR 2: routes 512: Disable rates 1024: rates to DNIS The sum of all numbers will come 2047 always. Now how i can know in $val which number is assigned for which description, and if i need to make some modification like i need to remove the IVR (64) and enable Active (1), which logic so i use. I am sorry if this question is not more clear, please let me know i can do more explination. Regards
  8. Hi friends, Could you please help me in Installation of PHP with mySQL support? I have installed mysql Ver 14.12 Distrib 5.0.22 with yum but when i am trying to install php-5.2.1 : ./configure --with-mysql=/usr/local/mysql i am getting the following error in make install Installing PEAR environment: /usr/local/lib/php/ /usr/local/php-5.2.1/sapi/cli/php: error while loading shared libraries: /usr/local/mysql/lib/libmysqlclient.so.15: cannot restore segment prot after reloc: Permission denied Could anyone please guide me how i can install php with mysql support.
  9. Hello, I am doing CallShop application which is going to have multi employee. and each employee will have different privileg to access his area. for the example 1- Employee     * Create Phone Booth     * Add balance to Booth     * Rollback etc...     * Modify calling rate 2- Employee     * Add balance     * Rollback     * View Call Logs What i was making my logic to create function for each action and store it in one table with Employee ID. so when employee will login in his control panel only those fuction will be called which is assigned by admin. Or is there any better way? Abdul
  10. Hi all, I am looking some idea about to create control panel with privileg. and the DB will be MySQL. Here is the full stracture which i need. I will have one Admin account who will have full access of all tools. and he will create one reseller and assign some releated tool privileg so the reseller can access what admin giving him permission. For the example: Admin have full tools: tool1    tool2        tool3 tool4    tool5        tool6 He created one reseller and assign assign only tool3 and tool6 from checkbox while he was creating new reseller. once reseller will login he will see only: tool3    tool6 I hope this explaination will be sufficient. So please advice me what should be logic to do these setup in PHP with MySQL. Regards,
×
×
  • 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.