Jump to content

srinivas6203

Members
  • Posts

    53
  • Joined

  • Last visited

Posts posted by srinivas6203

  1. HI

     

    $update = "update sip set outbound_cid = '" . $_POST['outcid'] . "',never_override_cid = '" . $_POST['keepcid'] . "',max_chan = '".$_POST['maxchans'] . "',disable_trunk = '".$_POST['disabletrunk'] . "',monitor_trunk_failures = '".$_POST['failtrunk']. "',monitor_trunk_failures_stat = '" . $_POST['failtrunk_enable'] . "',dial_rules = '" . $_POST['dialrules']."',dialrules_wizard = '".$_POST['autopop']."',outbound_dial_prefix = '".$_POST['dialoutprefix']."',trunk = '".$_POST['channelid']."',peer_details = '".$_POST['peerdetails']."',user_context = '".if(isset(!$_POST['peerdetails'] && !$_POST['userconfig'])) $username_c."',user_details = '".$_POST['userconfig']."',register_string = '".$_POST['register']."' where id = '".$trunk_id."'";

     

    In the above can u find out any error. I got a error like

    Parse error: syntax error, unexpected T_IF

     

    Thanq

  2. Hi all

    I am doing a website. when user edit his account total details are stored into the database. Then he click "apply changes" link, a .conf file will be generated with his total details fetching the values from database.

     

    Total these task working fine. But management asking as

     

    "When user edit his account then only 'apply changes' link will be come. The link will be there until he click that link.

    If he click that link .conf file will be generated with his modified details. otherwise the link will be there until he click that.

     

    any idea pls

     

    thanq

  3. Thanx for ur reply

     

    $dh="/var/www/admin/";

    //`sudo chmod 777 $dh`;

    $file="additional.conf";

    $fullpath=$dh.$file;

    `sudo chmod 777 $fullpath`;

    $create_file=fopen($fullpath,"w+");

    $sql=mysql_query("select * from table");

    while($row=mysql_fetch_array($sql)) {

    $content =$row['field']";

    }

    file_put_contents($fullpath, $content);

    fclose($create_file);

    if($create_file) {

    header('location:index.php');

    } else {

    echo "file not generated";

    }

     

    here $content ="host=***provider ip address***

    username=***userid***

    secret=***password***";

     

    This is the code.

  4. Hi

    i am generating one file with data which was getting from database table using php. The data was as following.

     

    host=***provider ip address***

    username=***userid***

    secret=***password***

     

    But this data was displayed in file as follows

     

    host=***provider ip address***^M

    username=***userid***^M

    secret=***password***^M

    type=peer

     

    I dont want to print this '^M' character. Why because, because of this character i will be face so many problems according to the security.

     

    Can any one help me out. pls

     

     

  5. I tried by the using of following script. But i got errors.

     

    $path="var/www/files/";

    $file=$path."test_file.txt";

    $fp=fopen($file,"w");

    //echo file_put_contents($file,"Hello World. Testing!");

    fwrite($fp, 'sample data');

    fclose($fp);

     

    I got following errors:

     

    Warning: fopen(var/www/files/test_file.txt) [function.fopen]: failed to open stream: No such file or directory in /var/www/admin/conf_changes.php on line 11

     

    Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/admin/conf_changes.php on line 13

     

    Warning: fclose(): supplied argument is not a valid stream resource in /var/www/admin/conf_changes.php on line 14

     

    Please help me out.

  6. Hi The Little Guy

    Thanq for ur cooperation. I tried that script wha u have to send.

    the auto increment id was added (+)  to prefix by using your script. Example: Auto increment id is 1. Our prefix is 999. After update the table the id value is 1000 (999+1). But i want 9991.

  7. I am doing one website using php and mysql.

    Afeter complete the registration the user details stored into the database. At this time i want to prefix some number to auto increment id. For example user id is 3. I want to prefix some 999 to that id. Finally i want to store the id as "9993". Is this possible.

     

    If that is not possible. there is another way.

     

    make the number using some loop with starting 9991 to etc. Make sure those numbers are unique and must starts with 999. Per each registration i have put the number into database as user id.

     

    Can any one help me.

  8. hi all

     

    I want to print email from file. the file contains like this.

     

    time=""

    register=no

    mailserver=mail.google.com

    email=nani@gmail.com

    password=xxxxxxxxxxxxxxxx

    status="online"

     

    From this i want to get email and print it on to the browser. i con't use line wise print. because that file will change the order every time , That means , now email row was in 4th line. after refresh the browser that email row might be go into the 2nd or last line etc. So first i want find word "email=" and then retrieve correspondent email "nani@gmail.com" and print that email. like wise remaining fields.

     

    can any one send me script or url's.

     

    please its urgent.

     

    thanq

  9. Hi all

     

    I have some bunch of data like this.

     

    askdhasdkf[sld[askfsdjflasjdajjdljkd;askd;ad[addjljdlaldajdjad "jshdkjshdsd@gmail.com" sajdkasjdlsjd dsakdhal sjdlasjdksajdjsapj kdpsoakdpoa skdklasdsa daddasd dadsadj asjdoijdo; iqwueiqe pqjlnd sandsahdsj dghkjshd kadsadsakhdkjsahdkjd.

     

    In the above paragraph there is a email id "jshdkjshdsd@gmail.com". I want to get that email id. I am not using database.

     

    Is there any possibility to get that email id from that paragraph using php.

     

    Kindly tell me ASAP. Its urgent.

     

    Thanq

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