Jump to content

knowram

Members
  • Posts

    226
  • Joined

  • Last visited

Everything posted by knowram

  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.
  16. I am running php 5.2.6 and IIS 6 and having problems connecting to a mssql database. It seems like the request to connect isn't even being sent out but i am getting this error "Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server:" Which makes me think it's trying to connect but I am not seeing any attempts in the log on the sql server. Any ideas? Thanks for any help in advance.
  17. I am using googles API to plot some location info that I am pulling from a MSSQL database. I would like the page and info to refresh it's self and get the current info from the Database each time. So I am using the SetTimeout java command to reload the map frequently and then using a HTML page refresh to reload everything every so often. My problem is that when the map refreshes from the SetTimeout it doesn't seem to be pulling new data from the database and I am not sure why. I have attached my page to this post. Any info would be much appreciated. Thank you all [attachment deleted by admin]
  18. I am new to javascript and don't use it much at all but i am trying to combine these 2 functions. Can someone please take pity on me and tell me what I am doing wrong. Thank you in advance. I am working with google's API the first function looks like this function importanceOrder (marker,b) { return GOverlay.getZIndex(marker.getPoint().lat()) + marker.importance*1000000; } and is used in this code var marker = new GMarker(new GLatLng(43.90,-78.5),{zIndexProcess:importanceOrder}); marker.importance = 2; map.addOverlay(marker); the second function looks like this function createMarker(point,html,ba,ov) { var mylabel = {"url":overlay[ov], "anchor":new GLatLng(4,4), "size":new GSize(12,12)}; var Icon = new GIcon(G_DEFAULT_ICON, background[ba], mylabel) var marker = new GMarker(point,Icon); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } and is used in this code var point = new GLatLng(43.90,-78.0); var marker = createMarker(point,\''.$Cap.'\',\'Up\',\'A\'); map.addOverlay(marker); And this is my attempt to put the 2 of them together. function createMarker(point,html,ba,ov,b) { var mylabel = {"url":overlay[ov], "anchor":new GLatLng(4,4), "size":new GSize(12,12)}; var Icon = new GIcon(G_DEFAULT_ICON, background[ba], mylabel) var marker = new GMarker(point,Icon,{zIndexProcess:importanceOrder}); marker.importance = b; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html) }); return marker; } and the code trying to use it var point = new GLatLng(43.90,-78.0); var marker = createMarker(point,\''.$Cap.'\',\'Up\',\'A\',\'2\'); map.addOverlay(marker); Thank you again for any help
  19. Can someone give me the syntex to connect to a mssql database and run a query with javascript please? Thank you for all the help.
  20. hmm here is what I have $iptL = mssql_query("select DevicePool.Name, Device.Description, Device.Name as Mac from DevicePool JOIN Device ON DevicePool.pkid = Device.fkDevicePool JOIN DeviceNumPlanMap ON Device.pkid = DeviceNumPlanMap.fkDevice JOIN NumPlan ON DeviceNumPlanMap.fkNumPlan = NumPlan.pkid WHERE NumPlan.DNOrPattern = '$iptDevice[DNOrPattern]' AND Device.Name NOT LIKE 'ADP%'"); $iptLab = mssql_fetch_array($iptL, MSSQL_ASSOC); then when i try to call on $iptLab['Mac'] i get an error.
  21. I remember seeing somewhere that you can change the name of the variable you are selecting in the select statement but i can't remember how to do it. something like select DevicePool.Name as DPName so that in the rest of the page I can refer to that variable as DPName not Name. Thanks for the help.
  22. the sql is running on a windows server and i can ping it. I have not heard of FreeTDS is that a mac or windows thing?
  23. I have an apple that I have set up to run php. for some reason when I try to connect to a mssql server I get this error Warning: mssql_connect(): Unable to connect to server: The thing, it doesn't really seam like it is trying to connect. I know the user name and password works because it connects from a different server just fine. Any ideas? Thanks for the help
  24. is it possible to select multiple databases from the same server? Thanks for the help.
  25. from what I can tell you can use header statements to trigger downloads when a page is loaded. Is there a list somewhere of the content types? Or is there a better way to trigger a download? Thanks for 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.