Jump to content

openpotion

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

openpotion's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm just ecstatic I finally got it working with get... I'll try changing the forms again to post and see what happens... what sort of echo command can I use to display the error?
  2. when I change it to post it fails... there are 2 php files linked to this form... I'd have to know a lot more to change it to post. Maybe I'll check with the API provider.
  3. Sorry... I was getting a blank page for a while... maybe a messup fixed by the suggestion here to put an exit after header?
  4. Well the API provided by solve360 gives GET example that I modified... because I guess it connects to an existing user and updates it?
  5. I'm now checking with my hosting... I think it is actually a security issue... Sorry if that is the case.. I'm really new to PHP (just started reading up on it) and really appreciate the help.
  6. Looks like this may not even be a php issue... how frustrating!!! ;-) http://suhastech.com/blogger/solved-url-in-get-post-request-not-working-403-forbidden-http-urlencode/
  7. ok not working... works in the text field: http:// ebay.com // //ebay.com ://ebay.com test http://wwwebaycom is great. won't work: http://ebay.com test http://www.ebay.com is great. here is the GET url that won't work: http://www.website.com/submit?firstname=aoeu&lastname=test&cellularphone=aaoeu&businessemail=aoeu%40aoeu.com&background=test+http%3A%2F%2Fwww.ebay.com+is+great&url=&Submit=Contact+Me!
  8. wow... apparently it is now working... perhaps the exit on header suggestion. Thanks!
  9. This is part of the form I am concerned about... form id="form-login" name="form-login" method="GET" action="submit"> <fieldset> <dl> <dt><label title="" class="hasTip required" for="jform_contact_message" id="jform_contact_message-lbl">Project Details<span class="star"> *</span></label></dt> <dd><textarea class="required" rows="2" cols="30" id="jform_contact_message" name="background" aria-required="true" required="required"></textarea></dd> </dl> if someone enters two forward slashes they just get an error. How do I change the php to allow the slashes to work properly? I can enter a single slash or anything else I have tried, but not //.
  10. Thanks! updated this. I'm an absolute beginner, and have been customizing this API example from my CRM provider.
  11. So I built a form and if anyone puts // in the text area field named name="background" it won't work... it fails. This prevents users from entering website URLs, which is an issue since the form is related to website design. I think I have everything else working just fine. Any ideas how I can change this so it will work and allow // ? There may be other things that cannot be entered or maybe a security risk I am missing... here is the code... <?php // version 2.2 // All placeholders that are used such as {yourEmail@yourDomain.com}, {yourSolve360Token}, {ownership}, // {categoryId}, {templateId} should be replaced with real values without the {} brackets. // REQUIRED Edit with the email address you login to Solve360 with define('USER', 'me@me.com'); // REQUIRED Edit with token, Workspace > My Account > API Reference > API Token define('TOKEN', 'itentionallydeleted'); // Get request data $requestData = array(); parse_str($_SERVER['QUERY_STRING'], $requestData); // Configure service gateway object require 'Solve360Service.php'; $solve360Service = new Solve360Service(USER, TOKEN); // // Preparing the contact data // $contactFields = array( // field name in Solve360 => field name as specified in html form 'firstname' => 'firstname', 'lastname' => 'lastname', 'businessemail' => 'businessemail', 'cellularphone' => 'cellularphone', 'background' => 'background', ); // kill form if spammers use the siteURL field if ( $_GET['url'] != '' || $_GET['firstname'] == 'Your Name' || $_GET['businessemail'] == 'Email Address' ) {header("Location: http://www.openpotion.com/new/error");} else { $contactData = array( // OPTION Apply category tag(s) and set the owner for the contact to a group // You will find a list of IDs for your tags, groups and users in Workspace > My Account > API Reference // To enable this option, uncomment the following: // Specify a different ownership i.e. share the item 'ownership' => 18634876, // Add categories 'categories' => array( 'add' => array('category' => array(18660073)) ), ); // adding not empty fields foreach ($contactFields as $solve360FieldName => $requestFieldName) { if ($requestData[$requestFieldName]) { $contactData[$solve360FieldName] = $requestData[$requestFieldName]; } } // // Saving the contact // // Check if the contact already exists by searching for a matching email address. // If a match is found update the existing contact, otherwise create a new one. // $contacts = $solve360Service->searchContacts(array( 'filtermode' => 'byemail', 'filtervalue' => $contactData['businessemail'], )); if ((integer) $contacts->count > 0) { $contactId = (integer) current($contacts->children())->id; $contactName = (string) current($contacts->children())->name; $contact = $solve360Service->editContact($contactId, $contactData); } else { $contact = $solve360Service->addContact($contactData); $contactName = (string) $contact->item->name; $contactId = (integer) $contact->item->id; } if (isset($contact->errors)) { // Mail yourself if errors occur mail( USER, 'Error while adding contact to Solve360', 'Error: ' . $contact->errors->asXml() ); die ('System error'); } else { // Mail yourself the result mail( USER, 'A new sales lead has been posted to Solve360', 'Contact "' . $contactName . '" https://secure.solve360.com/contact/' . $contactId . ' was posted to Solve360', 'From: noreply@openpotion.com' . PHP_EOL . 'Reply-To: ' . $contactData['businessemail'] . PHP_EOL . 'X-Mailer: PHP/' . phpversion() ); } // // OPTION Adding a activity // /* * You can attach an activity to the contact you just posted * This example creates a Note, to enable this feature just uncomment the following request * */ /* // Preparing data for the note $noteData = array( 'details' => nl2br($requestData['note']) ); $note = $solve360Service->addActivity($contactId, 'note', $noteData); // Mail yourself the result mail( USER, 'Note was added to "' . $contactName . '" contact in Solve360', 'Note with id ' . $note->id . ' was added to the contact with id ' . $contactId ); // End of adding note activity */ // // OPTION Inserting a template of activities // /* * You can also insert a template directly into the contact you just posted * You will find a list of IDs for your templates in Workspace > My Account > API Reference * To enable this feature just uncomment the following request * */ /* // Start of template request $templateId = {templateId}; $template = $solve360Service->addActivity($contactId, 'template', array('templateid' => $templateId)); // Mail yourself the result mail( USER, 'Template was added to "' . $contactName . '" contact in Solve360', 'Template with id ' . $templateId . ' was added to the contact with id ' . $contactId ); // End of template request */ header("Location: http://www.website.com/thank-you"); } ?> Thanks a ton in advance! Jason [attachment deleted by admin]
×
×
  • 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.