Jump to content

severndigital

Members
  • Posts

    355
  • Joined

  • Last visited

Everything posted by severndigital

  1. First off .. i really appreciate all you help. it just doesn't seem like it is submitting the form. correct me if i am wrong, but i when I echo $login->getResponseBody(). I should be seeing the page I would see if i was logged into the site... correct?? Here is my code thus far. $DSUrl = 'http://www.mysite.com'; $user = "username"; $pass = "password"; $login = new HttpRequest($DSUrl . '/Login',HttpRequest::METH_POST); $post_data = array("username"=>$user,"password"=>$pass); $login->addPostFields($post_data); $post_file = $DSUrl . "/ApplyLogin"; //form action $login->addPostFile("Login",$post_file); try { $login->send(); echo $login->getResponseBody(); }catch(HttpException $ex){ echo $ex; } I believe that is correct, but all i get is the login page over and over again. ***EDIT*** I added the HttpRequest::METH_POST and got the following exception exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message Also one thing i noticed the form and the submit button are both named "Login" .. could that be causing the problem??
  2. thank you for that. I got it working sort of, I believe that the information is going in, but the wrong submit button is being clicked. is there a way to control which form is being populated and submitted? here is what I have so far $DSUrl = 'my.site.com'; $user = 'username'; $password = 'password'; $login = new HttpRequest($DSUrl . '/Login'); $post_data = array("username"=>$user,"password"=>$pass); $login->addPostFields($post_data); try { $login->send(); echo $login->getResponseBody(); }catch(HttpException $ex){ echo $ex; } When i run the code the log in page appears on my screen so it is going and getting the page. There is a search form at the top and the login form is in the middle. Thanks for any help again, -P
  3. can you explain this line please?? the rest makes sense.. thanks.
  4. I am working on script that logs me into a site and preforms a search on that site using the HttpRequest / HttpResponse classes. I have them all installed, configured and working. I just can't seem to figure out the usage. I've been on the php.net pages for a few hours now and just can't make heads or tails of what's going on. here is what I have so for $url = 'my.site.com'; $username = 'username'; $password = 'password'; $login = new HttpRequest($url . "/Login"); // I figure I need to get the fields or set the fields, but I can't figure out which method actually does that. then once it does, how do get the reponse back from the site? i thought I would be using the httpReponse to do that, but I'm not so sure. Any help or a point to a good tutorial would be great. Thanks, -P
  5. after a bit of research, it looks like the pecl java extensions do not exist anymore, or at least they don't show up in any pecl search (both on the website and the command line) I understand that it is possible to create a "bridge" using SOAP, but I can't seem to find any real information on the subject. the article I could find on the subject http://rwatsh.blogspot.com/2007/03/integrating-java-and-php-web-services.html suggests a link using the WSDL and a soap connection. I am looking into the availability of a WSDL for the software we are using, but as of right now, i don't believe one exists. Any suggestions?? Thanks again.
  6. I'm not sure if this should go here or in the Java forum, if it needs to be moved, please feel free. I am trying to connect to a java based application on our server. They company has provided me with documentation referencing the API functions and what not. But no one can give me a clear answer on how to use those API functions within PHP. Can someone here at least give me a basic "concept" as to how I can / should be able to interface with the API ... or am I trying to do something that is not possible? thanks in advance. -C
  7. the command still asks for the password. I need PHP to be able to input the password for the other machine.
  8. forget it .. i am just going to have server 1 create a file with the command line it needs run in it. then i will have server 2 watch the folder, if it sees a file there, it will parse it, execute the command and delete server 1 created file.
  9. yeah i know, but then it prompts for a password ... how do i put that in there?
  10. i'm just trying to get into the other box using in the command line directly I would type ssh servername -l username it will prompt me for a password Once I am logged into the other box, I would just issue the command line I need. the command line is an actual program command not just an ls or something so I'm not sure FTP_SITE would work. it looks something like this /usr/bin/app p32 -P -T7we -p/tmp/output/filename.xml -gd=true it basically tells one of our production applications to export certain data and output it to an xml file that our website will then pick up.
  11. another good place to start be would be with the question ... what kind of database is it? or is it just web pages with information on it? if the latter is true .. you will really need to learn how to use preg_match very well. Even then, it might not be possible to get everything out exactly the way you want it.
  12. SO i need to run an command line from my PHP script ... the only problem is, the command needs to be run on a different server. i need to log into the other server using SSH and then run the command. how I get PHP to do that?... CAN I get php to do that? I looked into the ssh2 commands, but I won't be able to install that on our webserver. I guess my biggest hold up is that the ssh command prompts me for a password. How can I get around that? or get PHP to input the password for me? Any help would be great. Thanks
  13. well my initial fix will be to have them type in the name of the folder they want. and use Ajax/PHP to go to the server and return a list of directories that match and allow them to select one. I understand the potential security risks involved with the file uploaded, but it would be nice to easily capture a folder name within native HTML .. Oh well ... off to Ajax ... whoot!
  14. I see. So what happens to the information when they select a file? for example if i choose a file on my main drive the file text field fills up with something like C:\myFolder\anotherFolder\YetAnotherFolder\myfile.pdf I know this has nothing to do with you ... it just seems odd that it would retain that information in the field, but won't transfer it during a post or get. I suppose I could use a javacript to extract the folder path from the field on a onBlur or something but i would still need to have them select a file within the folder. Hmmmm... i'll have to dig into this one a little deeper.
  15. does anyone know of a solution to this problem. I would like to use an item similar to the <input type="file" name="folderSelect" id="folderSelect" /> But the user would only be selecting a directory. ALL the form field needs to get is the name of the directory they selected. The site and/or the script is not going to do anything with the directory. All it will do is write the information to an XML file that is getting picked up by another system. All i need to do if give the user the ability to choose folder from one of our internal network shares. the background application will determine the rest of the information it needs. anyone have a suggestion? Thanks, Pendal
  16. here is my function function loadContent(id,inner,phpFile,formName){ document.getElementById(formName).submit(); } when i run it i get the error document.getElementById(formName).submit is not a function [break on this error] document.getElementById(formName).submit(); why isn't it swapping out the variable when it runs this line? Thanks, C
  17. I have an XML file that comes to me like this... <book id="bk101"> <author>Gambardella, Matthew</author> <bktitle>XML Developer's Guide</bktitle> <genre>Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description> </book> I would like to position the book title first and the author underneath it. is it possible to do so, without having the xml regenerated? Thanks,
  18. this is going to sound wierd, but it may be the use of the word and ... try using && instead
  19. if you need to take a graphical approach ... you could use the GD image library to draw the lines or if you just need a straight breakdown you could also feed the horses into a list and control the formatting with CSS
  20. lol .. your issue isn't lazy .. you search is there is a parameter for doing a lazy search or a greedy search.
  21. OK fair enough .. is there anyway i can extract just that whole table then?? for example it is the only table on the page with this as the tag. <TABLE BORDER=1 cellspacing=0 cellpadding=3> once i have isolated that table, i could do a substr or something to get the information out that i need. Thanks again for all the help the tip of the regex iceburg is at least starting to make sense.
  22. I am trying to parse information in an html table here is the table <TABLE BORDER=1 cellspacing=0 cellpadding=3> <TR><TD><B>Name</B></TD><TD>NAME</TD></TR><TR><TD><B>Address</B></TD><TD>Address 1<br /> Address 2<br /> City State Zip<br /> </TD></TR> <TR><TD><B>Phone</B></TD><TD>PHONE</TD></TR> <TR><TD><B>Fax</B></TD><TD>FAX</TD></TR> <TR><TD><B>URL</B></TD><TD>URL</TD></TR> <TR><TD><B>E-mail</B></TD><TD>EMAIL</TD></TR> </TABLE> Ideally i would like to get the info into an array that looks like the table array('Name'=>'NAME',Address'=>'ADDRESS') and so on. but would just settle for an array of any kind. I can do simple string matches, but nothing this complex, could someone please help me out. Thanks in advance.. C
  23. thanks for the examples, but it was my fault for not explaining better so i'll give it another go tables: table_1 - list of events table_2 - list of event with user_id and the users status for the event userList - list of userIds so ... i want to display the status of the user if they have completed an event which would be listed in table_2. table_1 is the list of events. The end result should look like this EventName EventDate userStatus The query needs to do the following 1. list all the events from table_1 2. go into table_2 and see if the event_id has an entry with the user_id 3. show the status of the event for that user from table_2 The final result would look sort of like this Event1 3/20/2008 Submitted Event2 3/21/2008 Not Started Event3 3/22/2008 Incomplete Event4 3/23/2008 Not Started And so on. The query i had was almost working, but it would only work when the user had some activity on the event. Obviously if they did not start working on the event, there would be no entry in table_2, which was why I thought a left join would work. Thanks again for try to understand and taking a stab at it. I hope this helps clarify. -C
  24. a simple javascript that controls the display of one input based off of the content of another drop down box. here's what i have so far <script type="javascript"> function addField(){ var fieldValue = document.getElementById("grpType").value; if(fieldValue == 1){ // i want to show the new form element grpPassword and it's label here document.getElemetById("grpPassLabel").dispaly = block; document.getElementById("grpPassword").display = block; }else{ // i want to hid the form element grpPassword document.getElemetById("grpPassLabel").dispaly = none; document.getElementById("grpPassword").display = none; } } </script> not sure if this will work, but since it doesn't i assume I'm doing something wrong. Any suggestions would be great. Thanks, -C } [/code]
×
×
  • 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.