Jump to content

patrickmathews

New Members
  • Posts

    5
  • Joined

  • Last visited

patrickmathews's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I recently converted my business to an ip-pbx that has lots of capabilites. Among them is a feature I would like to use called http_notify. It sends a post to a url with parameters such as caller id number, caller id name etc.. I need to write a simple program to accept these parameters and write them to a csv file along with a date/time stamp. This seems like a super easy, short piece of code to come up with and as a noob I was hoping to write this myself. I have found a few examples where the post is for a form but I can't find any examples where the data is coming in as part of the url. This is the description of the feature on the phone system site: HTTP Notify Sends notifications to a remote web server through a URL. This allows allows an event in a Jive Core PBX to trigger an action on a remote system. Simply enter a URL in the node, and that URL will be hit with an HTTP POST as calls 'pass through'. Multiple variables are available and all variables are also included in the post body. URL Defines the URL to be used (limit of 255 characters). Next Node Connects nodes together to create a call flow. Drag and drop on the next node in the dial plan. Sample Use Cases 1. Trigger a remote application to generate a "screen pop" notification. 2. Trigger an email/SMS message in real-time. 3. Allow supplemental real-time call logging. Below is an example URL that passes the Caller ID number and the Dialed Number to a remote web server located at www.example.com: http://www.example.com/call_notification.php?caller={CALLER_ID_NUMBER}&dialed={DIALED_NUMBER} In the example above, variables in curly brackets { } are replaced with their actual value. For example, if a call to 801-555-0123 was placed from 909-555-0111, the URL would become: http://www.example.com/call_notification.php?caller=9095550111&dialed=8015550123 The following variables are available to use in URL variables. Variable In POST Body Description PBX_ID Y The ID of the PBX DIALED_NUMBER Y The number the caller dialed DNIS N Same as DIALED_NUMBER CALLER_ID_NUMBER Y The caller's number CNUM N Same as CALLER_ID_NUMBER CALLER_ID_NAME Y The caller's name (if available) CNAM N Same as CALLER_ID_NAME CALL_ID Y A unique ID for the call EVENT Y Always "URLNotifyNode.Notify" Does anyone have an example of something that accepts parameters and writes them to a file?
  2. I am in the process of developing a commercial web application to be offered as a SAAS to small businesses in the U.S. on a subscription basis. I have been working with a developer for a while now and the project timelines are starting to slip. I need someone to help get the project back on track and completed so we can roll it out and I can start selling it. Once the project is completed, there will be many ongoing opportunities for future work making customizations for specific customers and developing enhancements and new features and versions. It could very easily turn into a full time gig. A large portion of the project is done but there are some key features that need to be completed. I need to get this done as soon as possible - please contact me on skype - patrick.mathews67 or by email - patrick@systemvillage.com. It was started using phpixie and I think it would be best to continue with it, however, I need to get it done so I am open to suggestions.
  3. I ended up hiring someone to help out with this and he was able to solve it in very short order. thanks
  4. I tried this and got the same thing - I'm not sure, I'm using the right connection variable - is it $sqlbase or $mysqldbase?
  5. I have a website that has two separate databases - customdbase2 and sfdsomni. There are two problems I believe are caused by the system not pulling configs and coupons tables from the correct database: 1. Coupon amount is posted on the form, but the authorize.net transaction is for the non-coupon amount. The coupons table is in the customdbase2 database NOT the sfdsomni database. 2. Email is supposed to be generated (Thanks for signing up kind of thing). The email that goes through is blank. The configs tables contains the email text used to create the body of the message. The configs table is in the customdbase2 database NOT the sfdsomni database. There is a form that uses authorize.net to process a credit card for customers to make purchases. I've tested it and the purchase works and it goes through but it does not apply the coupon to the price and processes the transaction without the coupon. After the transaction goes through, I get the following: Thank you for signing up! You should receive an e-mail confirmation of your purchase soon. You may start right away by logging in here: http://www.x1234.com/driving/. Table 'sfdsomni.configs' doesn't exist Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in/home/content/90/11644390/html/www.x1234.com/includes/config.inc.php on line 296 Table 'sfdsomni.configs' doesn't existTable 'sfdsomni.configs' doesn't existTable 'sfdsomni.coupons' doesn't exist It seems to be asking for the two tables "configs" and "coupons" from the sfdsomni db when it should be getting them from customdbase2. In session.inc.php the database connects to customdbase2 as $sqlbase and sfdsomni as @sqlbase_de. I have looked in buynow.php and it is setting a $global that looks suspicious. <? session_start(); // removed these slashes to turn on https 1-13-2014 1116am if ($_SERVER[HTTPS] != "on") header("Location: https://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]); // turn these off if you want to disable adding the users to the database $adduser_normal = true; $adduser_driversed = true; $root_dir = "./"; require_once($root_dir."includes/config.inc.php"); require_once($root_dir."includes/overall_header.inc.php"); require_once($root_dir."includes/dbconnect.php"); $action = $_REQUEST[action]; if (empty($action)) $action = "showform"; $sqlbase = dbConnect(); $id = mysql_real_escape_string($_REQUEST[id]); if (empty($id)) exit; $sql = "SELECT * FROM packages WHERE packageID='$id'"; $query = mysql_query($sql, $sqlbase); echo mysql_error(); $pkg = mysql_fetch_array($query); if (empty($pkg[packageID])) exit; function create_uid() { global $sqlbase_de; /* THIS IS WHAT I AM SUSPICIOUS OF */ $size = 16; $str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; do { do { $id = ""; for($i=0;$i<$size;$i++) { $id = $id . substr($str,mt_rand(0,strlen($str)-1),1); } $row = mysql_fetch_array(mysql_query("SELECT id FROM ac_users WHERE UID='".mysql_real_escape_string($id)."'", $sqlbase_de)); } while ($row); } while(strlen($id) != 16); return $id; } if ($action == "checkcoupon") { $sql = "SELECT * FROM coupons WHERE code='".mysql_real_escape_string($_REQUEST )."' "."AND maxuses > timesused "."AND (expiration > NOW() OR expiration IS NULL)";$query = mysql_query($sql); echo mysql_error();$coup = mysql_fetch_array($query); if ($coup[code=auto:0] && $coup[minpurchase] <= $pkg[price]) {$_SESSION[couponID] = $coup[couponID];$dollaroff = $coup[amount] / $pkg[payments];$pkg[price] = number_format($pkg[price] - $dollaroff, "2", ".", ",");$action = "showform";}elseif ($coup[code=auto:0]){echo "You entered a correct coupon code, however the minimum purchase price for this coupon is ".displayAsCurrency($coup[minpurchase]).". Please try again.";$action = "applycoupon";}else{echo "You entered an invalid coupon code.<br /><br />";$action = "applycoupon";}} if ($_SESSION[couponID]){$sql = "SELECT * FROM coupons WHERE couponID='".mysql_real_escape_string($_SESSION[couponID])."' ";$query = mysql_query($sql); echo mysql_error();$coup = mysql_fetch_array($query);} $authnet_payments = $pkg[payments];$authnet_charge = $pkg[price];$product_title = $pkg[title];$product_desc = $pkg[description]; if ($action == "applycoupon"){?><a href="<?= $_SERVER[php_SELF]; ?>?id=<?= $id; ?>">Back</a> to order form.<br /><br /><form method="POST" action="<?= $_SERVER[php_SELF]; ?>"><input type="hidden" name="action" value="checkcoupon" /><input type="hidden" name="id" value="<?= $id; ?>">Coupon Code: <input type="text" name="code" size="30" value="<?= $_REQUEST[code=auto:0]; ?>" /><br /><br /><input type="submit" value="Apply Coupon" /></form><?} buynow.php config2.inc.php
  6. I am in need of some help with an existing website. The site was custom built about 4 years ago. It was coded without using any sort of framework. I have had some of these problems for a while and the hosting I was on made it difficult to get work done on it. I have recently migrated to Godaddy so I now have complete access to it. In the text below I have replaced the domain name with junk to avoid this page coming up on any searches. I am experiencing error messages in several areas: 1. When customer buys a product - the page that is output after a sucsessful authorize.net transaction contains the following: Thank you for signing up! You should receive an e-mail confirmation of your purchase soon. You may start right away by logging in here: http://www.^&%$#@.com/driving/. Table 'sfdsomni.configs' doesn't exist Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in/home/content/90/11644390/html/%$#@/includes/config.inc.php on line 296 Table 'sfdsomni.configs' doesn't existTable 'sfdsomni.configs' doesn't existTable 'sfdsomni.coupons' doesn't exist I don't see any table called configs in the sfdsomni database. I am unsure if this is the cause of the error or if it is an error with the parameter for mysql_fetch_array() or both. 2. When a customer signs up, an email is generated (welcome to our company - here is your login info kind of thing). The email that is being sent is blank and seems to have an unknown sender some of the time. There is an email text file that is editable by admins on the back end system - this seems to be fine and has not changed in years. This was a problem on the previous hosting company as well. 3. Some of the products include an online driver education course - I am receiving errors when I sign on to that as a new student: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/90/11644390/html/%$#@/driving/classes/config/courses.conf.php:155) in /home/content/90/11644390/html/%$#@/driving/classes/session.inc.php on line 70 4. As I mentioned in another post (http://forums.phpfreaks.com/topic/284998-how-do-i-keep-form-data-from-disappearing/) - I have a page used for purchases (buynow.php) - there is an "Apply Coupon" entry button on it. The coupon button currently links to another page which processes the coupon then take you back to a now blank (buynow.php). I'd like to add the coupon field to the buynow.php page and have the apply coupon button simply run through the coupon logic (this is already there and working) without leaving the buynow.php page. In other words - if a customer is buying something with a coupon - they fill out all there into (name, address etc.) add the coupon and hit "apply coupon" - when this button is pressed, if the coupon is valid - it adjusts the price. If it is not, it displays the error message without emptying the rest of the fields on the buynow.php page. 5. I would like to get the code documented so I have an idea of what file is calling what other file and where variables are being delcared. I have a feeling that there is a lot of superfluous junk lying around that is confusing me - I'd like to clean it up. Bid requirements: I need this to be a fixed cost bid for each of or a combination of the 5 problems listed, If you are confident that you can fix 1, 2 and 4 for $50 and you have no idea how much 3 will cost, please say so instead of guessing. As for the documentation - for each of the problems and mods I need to know exactly what you changed in what files and I need comments with your name and date in the code for future reference (ie /* changed by john doe on 1/12/2014 to fix apply coupon problem */) For the overall documentation mentioned in item 5 - I am looking for a document that will illustrate the relationship between the files - this can be graphical (I'd prefer it that way). Other work: I have plans to do some additional modifications to the structure of the site to increase usability. I also plan on a graphical face lift as well. I am hoping to find someone I can go back to for these jobs in the near future. I was hoping to take the time to figure these out on my own, but I have too much stuff going on and I don't want to expose my customers to these errors any longer than necessary. I am a novice at php - I feel like I could get a lot further if I could figure out how to turn on some sort of debug feature that would show me whats happening where and when. For right now, I need to get these problems fixed ASAP.
  7. I have site that was written as a custom job several years ago. Part of the site uses authorize.net allowing new customers to register and buy products online. It is all php/mysql. There is no framework involved. Most of the code is 3 - 5 years old. I am starting to go through it as we are migrating it to a new hosting platform and I"m realizing there are some changes that need to be made. One glaring annoyance is that the buynow.php page which is where people register and buy stuff has a link to enter a coupon code. The link takes the user to a new page with a simple form to enter a coupon code. Once the code is entered and the user hits submit, the code is validated and if all is well, the user is taken back to the buynow.php page. The only problem is that the user has entered a bunch of data (name, address, email etc..) and then got to the coupon code link, clicked it, came back to buynow.php, and the form is empty again. What is the best way to keep the form data saved and repopulate the form with that data when the coupon code is entered? I think it may be better to change the coupon code logic so it happens on the same buynow.php page, and updates the price when the user hits and "apply coupon" button. I am a php novice - I have done programming before but it's been a while and it certainly wasn't php. I've been through lots of php tutorials and read a lot about it. I'm hoping I can get some guidance here so I can make these changes myself and turn it into a learning experience. Thanks Patrick buynow.php
×
×
  • 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.