Jump to content

knowram

Members
  • Posts

    226
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

knowram's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. thank you guys for the input. I understand that just saying it doesn't work is not really helpful. I did that mostly because I am still trying to figure out the best way to do this. I have seen some posts that talk about the cURL library and now AbraCadaver has suggested HTTP classes. I am looking for something simple that I can simply update the XML that needs to be sent as well as the action ( POST, PUT, DELETE, GET). Sorry I didn't write the original post this way it's mostly only now become clear that this was my intention for this post. I know this is allot but would you be able to share an example of a POST with each method (cURL, HTTP classes) that has authentication by any chance?
  2. If I understand the API correctly I am trying to do 'POST','GET','PUT' or 'DELETE' functions with an XML payload. but even saying that I am not sure what it means.
  3. Hello all. I am a self taught developer and therefore only know what i have done so please be nice. I am trying to figure out how to use an XML API from cisco. They have given the following example. POST http://<server>/vmrest/users?templateAlias=voicemailusertemplate <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <User> <Alias>jdoe</Alias> <DtmfAccessId>7890</DtmfAccessId> </User> presumably if I really knew what I was doing this would make sense to me however it does not. I would like to be able to perform this function through a web interface with php. After doing some searching I found the following bit of code that I tried manipulate to to complete the function above however I am having problems getting it to work. <?php //You can use 'POST','GET','PUT' or 'DELETE' $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <User> <Alias>jdoe</Alias> <DtmfAccessId>7890</DtmfAccessId> </User>'; $auth = base64_encode('username:password'); $header = array("Authorization: Basic $auth"); $opts = array( 'http'=>array( 'method'=>'POST', 'header'=>$header, 'content'=>$xml ) ); $context = stream_context_create($opts); /* Sends an http request to www.example.com with additional headers shown above */ $url = 'http://172.16.16.121/vmrest/users?templateAlias=voicemailusertemplate'; $fp = fopen($url, 'r', false, $context); fpassthru($fp); fclose($fp); ?> If anyone could help point me in the right direction I would much appreciate it. Thank you
  4. I am trying to get my php installation to run PostqreSQL queries. Right now i am getting the following error Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option. I tried adding extension=pgsql.so to my php.ini file and restarting my server but that didn't work. I am running this on a MAC server. Thanks for the help
  5. So I know I can do the following. Say the Table name is Tabs $Tab = mysql_query("SELECT * from `Tabs` WHERE PID = '14'"); $Tab = mysql_fetch_array($Tab, MYSQL_ASSOC); And it will return first row in the table where PID = 14 or $result = mysql_query("select * from `Tabs` where PID = '14' ") or die ("nope"); while ($Tab = mysql_fetch_array($result, MYSQL_ASSOC)){ print_r($Tab); } and that will print all rows where PID = 14. What I am trying to do is just get the content of the second row where PID = 14.
  6. I am not sure if this question belongs in the mysql section or not so if it does forgive me. Say I have the following table: PID Action Hardware Set Dialplan 14 I test-HS-2 test2 14 I test-HS-1 TestDialpl 14 I test-HS-2 test3 I would like to select the second time PID = 14.
  7. Thanks Tazerenix After a little tweaking I got your script to work perfectly
  8. sorry should have added that this is an existing table and I just want to add a new row to it with the data in the second array.
  9. Yeah my first thought was to do something like that. An insert the first time around the loop and then an update each time after that but I am hoping there is an easier way.
  10. Wouldn't that insert a new row each loop?
  11. I am sure this is a newbe question but I have been scratching my head on this one for a while and am looking for some advice. I have 2 arrays array 1 Array ( [0] => PID [1] => Action [2] => Name [3] => Product Name [4] => Description [5] => Phone Protocol [6] => Product Model ID [7] => Host Name Prefix [8] => Maximum Number of Lines [9] => Maximum Number of Speed Dials [10] => Has a Screen [11] => Screen is Color [12] => Maximum Number of Buttons [13] => Maximum Number of Softkeys [14] => Maximum Number of Calls Waiting [15] => Default Maximum Number of Calls Waiting [16] => Maximum Busy Trigger [17] => Default Busy Trigger [18] => Maximum No-Answer Ring Duration [19] => Default No-Answer Ring Duration [20] => Maximum Number of Busy Lamp Fields [21] => Expansion Module Enabled ) array2 Array ( [0] => 1 [1] => I [2] => 7960 [3] => Cisco 7960 [4] => Cisco 7960 [5] => SCCP [6] => 7 [7] => SEP [8] => 6 [9] => 99 [10] => Y [11] => N [12] => 6 [13] => 0 [14] => 200 [15] => 4 [16] => 200 [17] => 2 [18] => 300 [19] => 12 [20] => 99 [21] => Y ) The first array is all the table headers and the second is the data that I would like to add to the table. I have been trying to come up with some way to use a loop or something to build an insert statement but haven't been able to come up with anything. Does anyone know any tricks? Thanks for the help.
  12. I think I found what I need. Thanks for the help everyone
  13. any ideas for a php script to create a thumbnail of the image being uploaded?
  14. Thanks for the help I will give it a shot.
  15. I am trying to figure out how to add an image uploading script to my site so that people can add a profile image. I have been searching for 3 days now and I must be looking in the wrong places. I am not sure which is best, to store the image in a mysql database or in a directory? Can someone point me in the right direction please? Thank you for all the help.
×
×
  • 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.