473,513 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Issue With cURL

6 New Member
i am in the closing stages of an sms application that will send different sms messages to different phone numbers. I will be using an sms gateway and my research led me to use cURL to implement the smpp api of the company that has the gateway. I was doing a test run of cURL on my localhost to see if all went smoothly before i implemented on the application(i wanted it to insert values into a table), but it was not working. I turned error reporting on and this is what i got:

Expand|Select|Wrap|Line Numbers
  1.  Notice: Use of undefined constant link - assumed 'link' in /srv/www/htdocs/sms/sms_connect.php on line 6 Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /srv/www/htdocs/sms/load.php on line 9 Notice: Undefined variable: ch in /srv/www/htdocs/sms/load.php on line 32 Warning: curl_close() expects parameter 1 to be resource, null given in /srv/www/htdocs/sms/load.php on line 32
  2.  
My original code is:
Expand|Select|Wrap|Line Numbers
  1. include 'sms_connect.php';
  2. $sql="select name from sms";
  3. $result=mysqli_query($link,$sql);
  4. while($row=mysqli_fetch_assoc($result))
  5. {
  6.    $name=$row['name'];
  7.    $url = "http://localhost/sms/index.php?name=".$name;
  8.    // create a new cURL resource
  9.    $ch = curl_init();
  10.  
  11.    // set URL and other appropriate options
  12.    curl_setopt($ch, CURLOPT_URL, $url);
  13.    curl_setopt($ch, CURLOPT_HEADER, 0);
  14.  
  15.    // grab URL and pass it to the browser 
  16.    curl_exec($ch); 
  17. }
  18. // close cURL resource, and free up system resources
  19. curl_close($ch);
  20.  
Thanks..
Oct 10 '11 #1
0 1374

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1464
by: Some Gei | last post by:
Hi All, I'm using a simple php+curl script to fetch a users feedback profile from eBay... for example from the following url: ...
3
2151
by: Ron M | last post by:
I am sure this is a simple issue, but being a beginner I am struggling. In the following js function I am attempting to make sure no numbers are within "name" controls. I want to pass the text...
4
1964
by: Gauthier | last post by:
Hi, I've a simple issue with the use of extension objects. I'm trying to call a text formating method from an object that I add to my arguments collection, this method take an input string and...
7
2265
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
4
2054
by: darrel | last post by:
We're a two person dev team with a handful of 'testers' that help us out. I'm looking for a simple issue tracker. I don't really want a full blown help desk/bug tracking system, but rather a...
5
3294
by: W.Sh | last post by:
Hello Everyone! I'm having some issues with javascript that I can't seem to resolve... Basically, I have a very simple code that's supposed to change the innerHTML of a span element whenever I...
1
1339
by: wctins | last post by:
I can't figure it out and I know is a simple issue, please help me! The message error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Syntax error (missing operator) in query...
12
12840
by: Benry | last post by:
I have two machines. Both have Windows xp Pro. Both have Visual Studio 6.0. These two versions differ only in Forms3 version. Machine 1 (M1) has version 11.0.6254, Machine 2 (M2) has version...
6
960
by: K Viltersten | last post by:
I'm running Vista Business, no SP yet and i'm trying to create a simple example of how to apply ASP to a webpage. The document is very short - containing the following lines of code. ...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.