PHP - Automatically Sending Sms
Hello friends,
In this topic i am getting confuse, and never know how to do work. My problem is that: 1>> I want to send SMS, by PHP pages to mobile. 2>> If user write some Quotation into the calender date, then automatically SMS send to all of those friend with the quatation metter. 3>> All work is store also in MYSQL database also. So please tell me what I do in this case because over the internet only SMS sending code is available, but automatically sms sending option is not given. Please help me then i do this job easily. Thanks Similar TutorialsHi, I have a project where i want to send the sms to the customers at the particular time calling from the database, how to do these in php? Thanks, From our website we are connecting to GMAIL to send our emails through SMTP. For some reason it is not sending the emails to the CC or BCC email address event though GMAIL shows it was included in the email. Am I missing something in the below code? Code: [Select] $currentTime = time(); $emailTo = "redbrad0@domain.com"; $emailCC = "brad@domain.com"; $emailBCC = "events@domain.com"; $emailSubject = "TEST Email at (" . $currentTime . ")"; $emailBody = "This is the body of the email"; $headers = array(); if (!empty($emailTo)) $headers['TO'] = $emailTo; if (!empty($emailCC)) $headers['CC'] = $emailCC; if (!empty($emailBCC)) $headers['BCC'] = $emailBCC; if (!empty($emailSubject)) $headers['Subject'] = $emailSubject; $headers['From'] = "events@domain.com"; $mime = new Mail_mime("\n"); $mime->setTXTBody($emailBody); $body = $mime->get(); $headers = $mime->headers($headers); $mail = Mail::factory('smtp', array ('host' => 'ssl://smtp.gmail.com', 'auth' => true, 'port' => 465, 'username' => 'events@domain.com', 'password' => 'thepasswordhere')); try { $result = $mail->send($emailTo, $headers, $emailBody); } catch (TixException $ex) { echo "<font color=red>Error:" . $ex->getCode() . "</font><br>"; } echo "Emailed at (" . $currentTime . ")<br>"; die; Hi, I was wondering if it is possible to have the foreign keys (FK) to automatically assign its value to the corresponding PK (primary key) it references? Let's say I have four tables (with their PK,FK and other fields) Code: [Select] TABLE document: TABLE pathway: TABLE leaf TABLE value: PK: docID PK:pathID PK:leafID PK:valueID filePath pathway FK:pathID FK:leafID fileName FK:docID value target source So when I upload a document, it is added to TABLE document, where PK docID set, and at same time I would add the filepath to TABLE pathway, and now I want TABLE leaf's FK to AUTOMATICALLY add the pathID, docID and ALSO at same time TABLE value's FK of leafID will also be added for that ONE entry that was initally added to TABLE document, pathway. Please I hope someone understand what I want to do, I know FK is for ensuring integrity of data. Please any help is appreciated. Please use my example to help me, thanks. PS: I know the formatting is off which I noticed when I went to preview the post, sorry. Hi Guys, I have the following $pattern = '<tr class="newsitem">'; when I echo this out it produces <tr class="newsitem"> </tr> Why is it automatically closing the tag? I dont want this becuase i'm using preg_replace and the tag is closed elsewhere already on the page. Hello, I am new here but I hope you can help me with a problem that I've been stuck with for days. I am trying to populate the content of a website through XML files (zipped) that are located on an FTP server. I managed to get the zip file but I'm not sure if it is the correct way: Code: [Select] function ftp_copy($file) { $conn_id = ftp_connect($ftp_host) or die ("Can't connect"); $ftp_login= ftp_login($conn_id, $ftp_user, $ftp_pass) or die ("Can't login"); ftp_pasv($conn_id, true); ftp_chdir($conn_id, "/zip_files/"); return ftp_get($conn_id, $file, $file, FTP_BINARY); } ftp_copy('1001.zip'); After that I will need to extract the zip file. I'm planning to use pclzip library for it and save the contents on a database. Also this has to happen everyday so I'm thinking about using a cron job, although hourly is also preferable since the XML files could be generated more than once per day. Am I doing it the right way or is there a better solution for this? Any help will me much appreciated! Thanks a lot! Hi,
I have the following function, but told I need to run it automatically. How would I do this?
<script> function replaceText() { var list = document.getElementsByTagName("UL")[22]; var list2 = list.getElementsByTagName("LI")[29]; list2.getElementsByTagName("LABEL")[0].innerHTML = "Car"; } </script>Thanks! This is an example of the forwarding section of the pagination code: if (($filename == $profile) && isset($select_category)) { echo " <a href='{$filename}?user=$user_name_get&sort_category=$select_category&sortSubmit=submit¤t_page=$next_page'>></a> "; echo " <a href='{$filename}?user=$user_name_get&sort_category=$select_category&sortSubmit=submitcurrent_page=$total_pages'>>></a> "; } elseif ($filename == $profile) { echo " <a href='{$filename}?user=$user_name_get¤t_page=$next_page'>></a> "; echo " <a href='{$filename}?user=$user_name_get¤t_page=$total_pages'>>></a> "; } elseif (($filename == $index) && isset($select_category)) { echo " <a href='{$filename}?sort_category=$select_category&sortSubmit=submit¤t_page=$next_page'>></a> "; echo " <a href='{$filename}?sort_category=$select_category&sortSubmit=submit¤t_page=$total_pages'>>></a> "; } else { echo " <a href='{$filename}?current_page=$next_page'>></a> "; echo " <a href='{$filename}?current_page=$total_pages'>>></a> "; } $filename = the opened filename + extension $profile = profile.php $index = 01.php I'm using several if and elseif statements to not have the pagination clash with the other GET data. I'd like to have the pagination simply append at the end of the URL with an ampersand if there is GET data already. If there's no GET data at all I'd like to have it append with a question mark. The problem with the solution I have now is, if I use more GET data in the future I'll have to use more elseif statements it will get out of hand. I've noticed that if you send GET data over a form that has method on GET, then the GET data will automatically decide if to add a question mark or an ampersand. In that sense my question would be, is there a way to make the pagination decide automatically to use a question mark or an ampersand? I'm wanting to make a sitemap for my website but as it's quite big there are a lot of url's I need to include. I was wondering if anyone know's of a way this can be done using PHP. e.g. using PHP to generate a list of URL's. I had a think myself but wasn't sure how to do it. Thanks for any help. Hi Everyone i am looking for a way to automatically upload a file but skip the browse and choose file process. So i set the location of the file somehow via the form and the client just has to click submit and it will automatcially upload the file from the path i have set. skipping the browse for file process. I would like to intergrate it into the following undesigns S3 Class http://undesigned.org.za/2007/10/22/amazon-s3-php-class/documentation <?php S3::setAuth(awsAccessKey, awsSecretKey); $bucket = "upload-bucket"; $path = "myfiles/"; // Can be empty "" $lifetime = 3600; // Period for which the parameters are valid $maxFileSize = (1024 * 1024 * 50); // 50 MB $metaHeaders = array("uid" => 123); $requestHeaders = array( "Content-Type" => "application/octet-stream", "Content-Disposition" => 'attachment; filename=${filename}' ); $params = S3::getHttpUploadPostParams( $bucket, $path, S3::ACL_PUBLIC_READ, $lifetime, $maxFileSize, 201, // Or a URL to redirect to on success $metaHeaders, $requestHeaders, false // False since we're not using flash ); $uploadURL = "https://{$bucket}.s3.amazonaws.com/"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>S3 Form Upload</title> </head> <body> <form method="post" action="<?php echo $uploadURL; ?>" enctype="multipart/form-data"> <?php foreach ($params as $p => $v) echo " <input type=\"hidden\" name=\"{$p}\" value=\"{$v}\" />\n"; ?> <input type="file" name="file" />&#160;<input type="submit" value="Upload" /> </form> </body> </html> at what point does it grab the file path ? is it grabbing it out of the name here <input type="file" name="file" /> can i do something with $_FILES ??? Can someone please give me a point on where to start i would really appriciate this. thanks I am very new to PHP and programming in general. About 3 weeks into this. I have this simple expression and some echo in my code. $x1 = $lat_b + $lat_a1; echo "<br>lat b: ".$lat_b; echo "<br>lat a1: ".$lat_a1; echo "<br>x1: ".$x1; $lat_b and $lat_a1 are derived from some xml extractions from a yahoo geocode api (that part works fine). The results of the expression and echos above are as follows: lat b: 40.402866 lat a1: 40.252590 x1: 80 Why is $x1 rounding automatically on me? Later, I substituted the expression above with $x1 = 40.402866 + 40.252590 ; The new result (shown below) makes sense to me. lat b: 40.402866 lat a1: 40.252590 x1: 80.655456 Hi, I've been wondering if it is possible to load a php page according to certain time. For example at 12:00 pm a php form will pop up automatically informing an employee to fill in something in the form, another form will pop up at 4:00 pm, etc... Thanks in advance hello guys. i need to run a script automatically at scheduled date and time. i am sending bulk emails . i need to setup an email campaign, in such a way that i can schedule like daily, monthly or quarterly.. can u guys give few tips to get it done.. Hi all, Recently I have found myself repeating a very monotonous task on amazon's kindle direct publishing website and (being the kinda guy I am), I figured I could probably automate it without too much trouble. I'm a publisher who needs to maintain my library of lots of books and ensure that any offers are kept up-to-date. I have made screen scrapes before without too much problem, but filling in forms is a little bit more difficult. There are no CAPCHA images to enter and this is specific to my own login so I don't think I can be considered "evil", so all I want to know is how to automate my own login, click a specific link and fill in forms. Ideally I want it as easy as recording a macro, or maybe just a list of instructions. If I told a human to do it, I'd just say "go to this page and click on that, enter these details to login, then click that" and I wondered if there is something out there in cyber world that allows me to do the same? Thanks, Neil <?php
require_once('upper.php'); require_once('LoginStatement.php'); require_once('database.php'); echo $error_msg=''; require_once('database.php'); $LoginId=$_COOKIE['LoginIdCookie']; $query="select * from registration where LoginId='$LoginId'"; $result=mysqli_query($dbc,$query); $row=mysqli_fetch_array($result); if(isset($_POST['submit'])) { $LoginId=mysqli_real_escape_string($dbc,trim($_POST['LoginId'])); $Name=mysqli_real_escape_string($dbc,trim($_POST['Name'])); $Age=mysqli_real_escape_string($dbc,trim($_POST['Age'])); $BloodGroup=mysqli_real_escape_string($dbc,trim($_POST['BloodGroup'])); if(!isset($_POST['Sex'])) { echo 'Please enter Sex<br>'; } else{ $Sex= mysqli_real_escape_string($dbc,trim($_POST['Sex'])); } $Qualification=mysqli_real_escape_string($dbc,trim($_POST['Qualification'])); $ContactNumber=mysqli_real_escape_string($dbc,trim($_POST['ContactNumber'])); $Email=mysqli_real_escape_string($dbc,trim($_POST['Email'])); $Address=mysqli_real_escape_string($dbc,trim($_POST['Address'])); $AboutYourself=mysqli_real_escape_string($dbc,trim($_POST['AboutYourself'])); //$countCheck=count($_POST['checkbox']); //echo $countCheck; //$checkbox=$_POST['checkbox']; //$countCheck=count($checkbox); if(empty($LoginId)){echo 'Please enter Login Id';} elseif(empty($Name)){echo 'Please enter Name';} elseif(empty($Age)){echo 'Please enter Age';} elseif(!isset($_POST['Sex'])){} elseif(empty($Qualification)){echo 'Please enter Qualification';} elseif(empty($ContactNumber)){echo 'Please enter Contact Number';} elseif(empty($Email)){echo 'Please enter Email';} elseif(empty($Address)){echo 'Please enter Address';} elseif(empty($AboutYourself)){echo 'Please enter About Yourself';} else { if(mysqli_num_rows($result)==0) { $checkbox=$_POST['checkbox']; $countCheck=count($_POST['checkbox']); $reg_id=' '; for($i=0;$i<$countCheck;$i++) { $reg_id=$reg_id.$checkbox[$i].','; } $query="UPDATE registration SET (LoginId,Name,Age,BloodGroup,Sex,Qualification,ContactNumber,Email,Address,AboutYourself,Activity)values ('$LoginId',SHA('$Password1'),'$Name','$Age','$BloodGroup','$Sex','$Qualification','$ContactNumber','$Email','$Address','$AboutYourself',',$reg_id')"; $result=mysqli_query($dbc,$query) or die("Not Connect"); echo ' Dear '.$Name.'.<br>Your request has been mailed to admin.<br>Your account is waiting for approval<br>'; $from= 'Elite Brigade'; $to='ankitp@rsquareonline.com'; $subject='New User Registration'; $message="Dear admin,\n\nA new user request for registration. Please check it out.\n\nRegards\nMicro"; mail($to,$subject,$message,'From:'.$from); //header('Location: index.php'); // header('Location: Registration.php'); } else { echo 'Dear '.$Name. ', <br> An account already exist with login-id<b> '.$LoginId.'</b> <br>Please try another login-id'; }} } ?> <html> <head> <script src="jquery-latest.js"></script> <script type="text/javascript" src="jquery-validate.js"></script> <style type="text/css"> * { font-family: Verdana; } label.error { color: white; padding-left: .5em; } p { clear: both; } .submit { margin-left: 12em; } em { font-weight: bold; padding-right: 1em; vertical-align: top; } </style> <script> $(document).ready(function(){ $("#commentForm").validate(); }); </script> </head> <body> <?php echo $error_msg; ?> <form action='<?php echo $_SERVER['PHP_SELF'];?>' id="commentForm" method='post'> <div class="registration_and_activity"> <table border="0" width="380"> <tr><td colspan="2"> <h3>Update Personal Details</h3></td></tr> <tr><td width="120"> <em>*</em>Enter Login id</td><td width="150"><input type='text' name='LoginId' minlength='4' value='<?php echo $row['LoginId']; ?>' /></td></tr> <tr><td width="120"> <em>*</em>Enter Name</td> <td><input type='text' name='Name' value='<?php echo $row['Name'];?>' /></td></tr> <tr><td> <em>*</em>Enter Age</td><HEAD> <SCRIPT language=Javascript> function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } </SCRIPT> </HEAD> <td><INPUT onkeypress='return isNumberKey(event)' type='text' name='Age' value='<?php echo $row['Age'];?>'/></td></tr> <tr><td> <em>*</em>Enter Blood</td><td><input type='text' name='BloodGroup' value='<?php echo $row['BloodGroup'];?>' /></td></tr> [B]<tr><td> <em>*</em>Enter Sex</td><td><input type='radio' name='Sex' style='width:16px; border:0;' value='Male' checked='<?php if($row['Sex']='Male') echo 'checked';?>'/>Male <input type='radio' name='Sex' checked='<?php if($row['Sex']='Female') echo 'checked';?>' style='width:16px; border:0;' 'value='Female' />Female</td></tr>[/B] <tr><td> <em>*</em>Enter Qualification</td><td><input type='text' name='Qualification' value='<?php echo $row['Qualification'];?>' /></td></tr> <tr><td> <em>*</em>Contact Number </td><td><input onkeypress='return isNumberKey(event)'type='text' name='ContactNumber' value='<?php echo $row['ContactNumber'];?>' /></td></tr> <tr><td> <em>*</em>Enter Email</td><td><input type='text' name='Email'class="email" value='<?php echo $row['Email'];?>' /></td></tr> <tr><td> <em>*</em>Enter Address</td><td><input type='text' name='Address' value='<?php echo $row['Address'];?>' /></td></tr> <tr ><td > <em>*</em>About Yourself </td></tr> <tr><td colspan="2"><textarea rows='10' cols='40' name='AboutYourself' /><?php echo $row['AboutYourself'];?></textarea></td></tr> <tr><td> <?php echo "<tr><td colspan='2' align='center'><input type='submit' value='Update' name='submit' style='background:url(./images/button_img2.png) no-repeat 10px 0px; width:100px; padding:3px 0 10px 0; color:#FEFBC4; border:0;'/></td></tr><br>"; echo " </td></tr></table> </div> </form> </body> </html>"; require_once('lower.php'); ?> Hi friends.......... In above code I want that In database if Sex=Male then Male radio button will be checked automatically and if Sex =Female then Female radio button will be checked. But it not works ........... please help me........... thanks in advance.......... I am creating a drink recipe site. So far I have created the mysql table and the page where i can enter in the drink name ingredients ect. and it inserts into the table. Could some one point me in the right direction where when I make an entry into this table a new page is created from the content. How would I go about doing this?
I've been working on this html/php page for class and I just don't understand why my code is acting like this. This is my code <?php //error_reporting(E_ALL); //ini_set('display_errors', 1); $title = "Listing Search"; $file = "listing-search.php"; $description = "Listing Search page for real estate website (WEBD3201)"; $date = "2019-10-01"; $banner = "Listing Search page"; require "header.php"; ?> <?php $headline = ""; $minPrice = ""; $maxPrice = ""; $city = ""; $error = ""; $output = ""; $error = ""; $output = ""; if(isset($_GET["city"])) { $city = $_GET["city"]; setcookie('city',$city,COOKIE_LIFESPAN); $_SESSION['city'] = $city; } else if (isset($_COOKIE['city'])) { $city = $_COOKIE['city']; $_SESSION['city'] = $city; } if(!isset($city)) { $_SESSION['RedirectError'] = "Please select a city<br/>"; header("Location:listing-select-city.php"); } if(isPost()) { $minPrice = trim($_POST["minPrice"]); $output .=$_POST["minPrice"]; $maxPrice = trim($_POST["maxPrice"]); $output .=$_POST["maxPrice"]; $headline = trim($_POST["headline"]); $output .=$_POST["headline"]; $city = trim($_POST["city"]); $output .=$_POST["city"]; $error = ""; $output = ""; if($headline == "") { $error .= "<br/>Headline was not specified"; } if($city == "") { $error .= "<br/>City was not specified"; } if($minPrice == "") { $error .= "<br/>Minimum price was not specified"; } elseif (preg_match(PRICE_FILTER, $minPrice) == '0') { $error .= "<br/>Minimum price needs to be a number"; $minPrice = ""; } if($maxPrice == "") { $error .= "<br/>Maximum price was not specified"; } elseif (preg_match(PRICE_FILTER, $maxPrice) == '0') { $error .= "<br/>Maximum price needs to be a number"; $minPrice = ""; } if($maxPrice < $minPrice) { $error .= "<br/>Minimum price must be smaller than maximum price"; } } ?> <?php echo $error; ?> <?php echo $output;?> <h2>Search for a home.</h2> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <table style="margin-left: auto; margin-right: auto;"> <tr> <td> Listing Name </td> <td> <input type="text" name="newlist" value="<?php echo $headline ?>" /> </td> <td> City </td> <td> <input type="text" name="city" value="<?php echo $city ?>" /> </td> </tr> <tr> <td> Min Price </td> <td> <input type="text" name="minPrice" value="<?php echo $minPrice ?>" /> </td> <td> Max Price </td> <td> <input type="text" name="maxPrice" value="<?php echo $maxPrice ?>" /> </td> </tr> </table> <table style="margin-left: auto; margin-right: auto;"> <tr> <td> <input type="submit" value = "Search" /> </td> <td> <input type="reset" value = "Clear" /> </td> </tr> <tr> <td> <?php echo build_checkbox("internet", "DSL"); ?> </td> <td> <?php echo build_checkbox("heating", ""); ?> </td> </tr> </table> </form> <?php require "footer.php"; ?>
Looking for help writing a function that does the following: Look for http:// or https:// in a string and replaces it with an <a href> tag. For example: Here is my link http://www.mydomain.com some further text here. Becomes: Here is my link <a href="http://www.mydomain.com">http://www.mydomain.com</a> some further text here. Hi guys, Is it possible to make a page automatically redirect to the previous page a user was in once they submit a form? Thanks I'm quite new to PHP coding and I'm having trouble with what I'm sure is a common beginners problem. What I need is a method that first checks if there's variable being passed through the URL and if there is then pass the new variable with an & instead of a ?. I have been able to do this with a code that looks something like this: Code: [Select] if (isset($_GET['firstvar'])): header ("Location: index.php?firstvar=1&secondvar=2") else: header ("Location index.php?secondvar=2"); endif; The problem with this code is that I always need to adapt it to different parts of the code where "firstvar" is different. So basically what I'm asking is; is there a way to check if any variable is being passed through the URL and if there is then pass a variable beginning with & at the end of the url. P.S I've tried using $_SESSION['REQUEST_URI'] to get the url and pass variables at the end of that. The problem is that I have a pagination function that makes the URL look like www.mywebsite.com/index.php?page=1&page=2&page=3 etc etc. |