Jump to content

JasonHarper

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by JasonHarper

  1. UPDATE: I downloaded SoapUI so I could see what's going on. It turns out the XML being generated is almost correct with one small issue....the header is inserting <item> and <key> tags within the XML: <securityCredentials> <item> <key>applicationId</key> <value>ABCDEF</key> </item> </securityCredentials> What I need is: <securityCredentials> <applicationId>ABCDEF</applicationId> <token>123456</token> </securityCredentials> If I could eliminate the tags, the XML would be correct. I've researched and can't seem to find a specific flag or setting so still stuck on what to do next.
  2. I'm trying to use the code below to make a SOAP request to a vendor's web service: $client = new SoapClient('http://my.domain.com/wsdl/GuestService.WSDL', array('connection_timeout' => 15, 'trace' => 1)); $ns = 'http://vendor.domain.com/'; $headerbody = array('brand' => 'BRAND1', 'locale' => 'en_us', 'securityCredentials'=>array('applicationId'=>'ABCDEF', 'token'=>'123456789123456789123456789')); $header = new SoapHeader($ns, 'Header', $headerbody); $client->__setSoapHeaders($header); $result = $client->getGuest(array('guestID' => '000787')); However, I'm getting an error back that no credentials were supplied so I must be doing something wrong. Error message: Uncaught SoapFault exception: [soapenv:NO_CREDENTIALS] I reached out to the vendor and they sent me an XML sample of how they're expecting to receive the data: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prox="http://vendor.domain.com" xmlns:gues="http://vendor.domain.com/guest"> <soapenv:Header> <prox:brand>BRAND1</prox:brand> <prox:locale>en_us</prox:locale> <prox:securityCredentials> <prox:applicationId>ABCDEF</prox:applicationId> <prox:token> 123456789123456789123456789</prox:token> </prox:securityCredentials> </soapenv:Header> <soapenv:Body> <gues:getGuest> <guestID>000787</guestID> </gues:getGuest> </soapenv:Body> </soapenv:Envelope> I thought I had accounted for everything in the above but maybe I'm missing something obvious. Really appreciate any help!
  3. Thanks KingPhilip! I implemented that code and now the form is indeed posting but the attributes of the button don't seem to be changing. Here is my current code: function fireSubmit() { document.emailNotifications.submitButton.disabled = true; document.emailNotifications.submitButton.value = 'Saving...'; document.emailNotifications.submit(); } </script> <form id="emailNotifications" name="emailNotifications" method="post" action="email-notifications.php"> <input type="submit" id="submitButton" name="submitButton" value="Save Changes" onclick="fireSubmit()"> </form>
  4. OK - thanks! The only jQuery I'm really using is for navigation based stuff. Everything else is all PHP.
  5. I'm trying to disable for more of a visual aesthetic...to let the user know something is happening. T he button changes color and says 'Saving' when in a disabled state. On my forms where the submit also processes a credit card transaction, I want to avoid multiple clicks.... Thanks again for the help!
  6. Thanks for the reply! Duh - that makes total sense - not sure what I was thinking. Is there an effective way to disable the button and still post the form? I'm OK with a page refresh.... Thank you!
  7. Hello, When a user clicks a Submit button on my page, I'm using an onClick event to essentially just disable the button and change the message to 'Saving'. However, when I add the onClick code, the form no longer posts using PHP. The button does indeed change but the postback never occurs. Is there something extra I need to add or do? Thank you!! This is my submit button: <input type="submit" id="submit" value="Save Changes" onclick="this.disabled=true; this.value='Saving'">|<a href="/">Cancel</a> Then I have the normal PHP stuff for postback which isn't firing.... //IF POSTBACK if ($_SERVER['REQUEST_METHOD'] == 'POST') { //DO STUFF HERE }
  8. Thank you! So right now I have: if($_POST['Submit']) Can you help me understand what the Submit_X is? Thank you! Jason
  9. Hello, I'm having a strange problem I can't seem to figure out. Traditionally in my php apps, I just use the standard html buttons. However, I've done one recently where I decided to use images as buttons. However, when a user submits a form using IE or Firefox, nothing happens. The form appears to post to the server because the fields are cleared but it's like no PHP code is executing. The page works fine in Chrome or Safari. Any idea how I can go about troubleshooting this? Thank you!!! Jason <input type="image" src="/images/button_submit.gif" name="Submit" value="Submit" alt="Submit" />
  10. That gave me what I needed! I had a typo in the database name. Thank you so much! Jason
  11. Hello, I have some code that has been running just fine on my in-house server. I moved it to an Amazon EC2 instance and now I get the following error: Warning: mysql_result() expects parameter 1 to be resource, boolean given in /var/www/INCLUDES/systemFunctions.php on line 174 Here is the code it's referencing: $result = mysql_query("SELECT count(*) FROM users WHERE userName='$email' AND password='$encryptPassword' AND accountStatus='1' AND accountVerified='1'"); $num = mysql_result($result, 0); I'm at a loss as to why this is happening. Thank you for any help!! Jason
  12. Hello! I'm sure I'm asking about a topic that has been answered but I can't seem to find the answer. I know mod_rewrite can be used to covert a querystring to a URL (i.e., /?string=TEST --> /string/TEST) but I'm trying to go the other way around. Here's my example: User goes to: http://www.mydomain.com/login/?id=12345 The ID is what identifies the customer so I know which database to reference. What I would prefer to do is replace that with a friendly name (that I will in turn use on the back end to lookup their customer ID). So, two questions.... How do I configure mod_rewrite so the customer can enter: http://www.mydomain.com/login/CompanyName and how do I capture the CompanyName value in PHP? Thank you so much!! Jason
  13. Hello, I've created a web application that customer subscribe to. Because they are storing sensitive data, I am using SSL to secure the site. Since I don't want to host a virtual directory/separate set of pages for each customer, I have a generic domain name/SSL that they then point a cname to: My URL: webapp.com Their CNAME: portal.mycompany.com When they hit my server, I redirect them to https://webapp.com However, many of the customers want to maintain their own URL in the browser bar and never want to see webapp.com. THe only way I know to do this is to create a separate virtual site with its own set of pages and an SSL certificate issued for the customer's domain. Is there any other way to do this so I can have their URL displayed in the browser bar? The entire application is written in PHP and I'm using Apache on CentOS. Thank you SO much for any help! Jason
  14. I just did a quick Google search for end of line issues with fgetcsv and one post said to add this: ini_set('auto_detect_line_endings', true); I added that to my code and it appears to be working perfectly! THank you schilly for putting me on the right track! Jason
  15. OK - disregard my last post - just needed to do a print_r instead of echo. I think I may know what the problem is I just don't know how to fix it. When I print the array, there aren't individual sets for each row. For example, the array is just [0]=>value, [1]=>value.....[255]=>value. Shouldn't there be some "nesting" for each line of the CSV? Thank you! Jason
  16. Thanks for your help! OK - so that makes things even stranger. When I echo $data, I just get Array - it's completely empty. Not sure I understand why - I double checked the CSV file and the data is in there... Jason
  17. Hello, I have a page where the user uploads a CSV file and I want to read that CSV and update database fields accordingly. It seems I have all the code correct but only the first row of the CSV is being imported. If I echo my variables within the loop, the only output is the first row of the CSV - no subsequent rows. I feel like I'm close but not sure what the issue is? Thanks a million for any help!! Jason //START FILE OPERATION $handle = fopen('uploads/testfile.csv', "r"); //LOOP CONTENTS OF CSV FILE while (($data = fgetcsv($handle, 1000, ",")) !== false) { $importID = $data[0]; $companyName = $data[1]; $primaryPhone = $data[2]; $primaryEmail = $data[3]; $billingFirstName = $data[4]; $billingLastName = $data[5]; $query = 'SELECT importID FROM import'; if (!$result = mysql_query($query)) { continue; } if ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { //UPDATE IF ENTRY EXISTS $query = "UPDATE import SET companyName='$companyName', primaryPhone='$primaryPhone', primaryEmail='$primaryEmail', billingFirstName='$billingFirstName' WHERE importID=$importID"; mysql_query($query); if (mysql_affected_rows() <= 0) { //NO RECORDS UPDATED } } else { //ENTRY DOESN'T EXIST } mysql_free_result($result); } //CLOSE FILE OPERATION fclose($handle);
  18. Hello! For a year now I've been using MySQL and Apache (with PHP code) on the same server. I've decided to build a separate MySQL server but I can't seem to access that server from my PHP applications on the other box. PHP returns an error that it can't connect to the MySQL server. I've tried creating users with the IP address of the web server (user@x.x.x.x) and without (user@%) and I still can't seem to access. I'm not an expert by any means so is there any kind of log or place I can look to tell me what's happening? Can the user @ be by IP address or does it need to be a hostname? The MySQL server has multiple IP's but the bind-address is set to 0.0.0.0. Thank you so much for any help! Jason
  19. Hello, I'm having an issue that I just can't seem to figure out. I have two include files - one that contains a function to return credentials for accessing the database and the other that generates/sends email. The issue that I'm having is that if I can change all the include_once to include, I get a fatal error that the function can't be redeclared. When I leave them as include_once, the first time the database credentials are needed, it works but subsequent calls to the function later in the code fail. I feel like I'm missing something very simple but just can't figure it out for the life of me. Thank you SO much for any help - I tried to illustrate my files/code below. Thank you! Jason Filename: access.php Purpose: Functions to provide database credentials to other functions/code function getDatabaseDetails() { //CODE IS HERE } Filename: email.php Purpose: Functions to retrieve data from DB and send email function sendEmail() { include_once '/includes/access.php' //CODE IS HERE } Filename: page.php Purpose: Actual content include_once '/includes/access.php' include_once '/includes/email.php' //CODE IS HERE
  20. Hello! I'm having a mental block and can't seem to accomplish the below: I have variables named in this fashion: $item1, $item2, $item3, $item4, $item5, etc. I'm retrieving values from a database and have a variable to hold an item count. Example: $itemCount = 1; //DO DATABASE STUFF $itemCount++; What I would like to do is assign values to the item variables based on the item count (i.e., if $itemCount were to be currently set to 5, it would assign the value retrieved from the DB to the variable $item5). I can't seem to figure out how to do this... Thank you for any help!! Jason
  21. Sorry! I figured this out. The field I was using as the key was boolean (0/1) so when I had repeat values it was overwriting. I switched to use something else that's unique as the key. Thanks! Jason
  22. Hello! I'm having a brain block today! I'm retrieving two values from my database and want to write them as a pair (key/item) to an array. The issue I'm having is that if there is more than one set of records from my database, the array only contains the last pair (i.e., the array isn't holding every pair retrieved from the DB). //DEFINE ARRAY $portalAnnouncements = array(); //GET PORTAL SPECIFIC ANNOUNCEMENTS $result = mysql_query("SELECT announcementText, announcementClass FROM announcements WHERE announcementInUse='1'"); while($record = mysql_fetch_array($result)) { $portalAnnouncements[$record['announcementClass']] = $record["announcementText"]; } A print_r will always show only one key/item pair even if there are multiple items retrieved from the DB. I'm sure I'm missing something simple - thank you for any help!! Jason
  23. Hello! This may not be the appropriate forum for this question since I'm also using JS but I thought I'd ask. I have a very simple JS that redirects a user based on selection from a drop down list. I need to include a query string (unique ID) in the redirect URL that I base64 encode to obscure the ID. When I use the PHP variable in the JS code without encoding, it works perfectly. When I implement encoding, it doesn't work. I'm guessing I need something like add slashes...? CODE THAT WORKS: function goto(form) { var index=form.drpFilter.selectedIndex if (form.drpFilter.options[index].value != "0") { location="/accountinfo.php?q=" + <? echo $uniqueID; ?>;}} CODE THAT DOESN'T WORK: function goto(form) { var index=form.drpFilter.selectedIndex if (form.drpFilter.options[index].value != "0") { location="/accountinfo.php?q=" + <? echo base64_encode($uniqueID); ?>;}} Thanks so much for any help! Jason
×
×
  • 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.