Jump to content

narjis

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by narjis

  1. Hi, I want to send an email to my registered users so that when they click on the URL given in the message hey should come back to my site as confirmetion of their registration. I am able to send the mail but the mail body is not coming as expected. Here's my code <?php public function email($id){ //get users info $this->userInfo = $this->model->listUser($id); $this->sendEmail($this->userInfo); } public function sendEmail($data){ $to =$data['email']; $this->msg ="<img src=\"ideas.kpjit.com/public/images/header-img.jpg\" /> <h1>KPJ Idea</h1> <p>Make a difference</p> <p>This is a Confirmation Mail.Please confirm your registration by clicking here <a href=\"http://ideas.kpjit.com\register\confirm\ <?php echo $this->data['id'];?></p>\" "; $subject = "Registration confirmation"; $message = $this->msg; $from ="narjisfatima@yahoo.com"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From:narjisfatima@yahoo.com' . "\r\n"; if(mail($to,$subject,$headers)){ $this->render2("register/message"); exit; } } Also I am unable to insert my site banner in the mail. How can I do It.
  2. Sorry if I did'nt clear my self this part of the code <div class="login-btn"> <div class="login-btn"><a href="#">Login</a></div> </div> is tag but by I am unable to send form values so I replaced it with <input type="submit" value="Login" /> Is there any way I can applay this css on my submit button. Thanks for replying
  3. <form action="login/run" method="post"> <h2>Login to KPJ Idea</h2> <p>Don't have an IdeaStorm account?<br /> <a href="login/run">Register Now.</a> </p> <fieldset> <label>Email</label> <input type="text" name="email" class="txt-field-login" /> <label>Password</label> <input type="text" name="pass" class="txt-field-login" /> <div class="login-btn"> <div class="login-btn"><a href="#">Login</a></div> </div> </fieldset> </form> I am unable to pass the values using Login css image but can only pass it through <input type ="submit" /> How is it possible to use a css effecty on a button.
  4. why does my mysql_num_rows always give the same err Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp2\www\e_commerce\e_commerce\admin\viewProducts.php on line 8 $conn= mysql_connect("localhost","root",""); mysql_select_db("ecommerce",$conn); $product_list=""; $sql = "SELECT * FORM products"; $query = mysql_query($sql,$conn); $exist = mysql_num_rows($query); although the very same code is running fine in another file of the same project. Please help me.
  5. I am using php version 5.3.0 and when i use the following statement i get error undefined fconsta=nt PATH_SEPERATOR. Please sommebody guide how to remove this error. Here is the code <?php define ("APP_PATH",realpath(".")); //include_once("com/user.php"); $path = array("APP_PATH", "APP_PATH" . '/com', get_include_path() ); set_include_path(implode(PATH_SEPARATOR,$path)); function __autoload($classname){ require_once $classname.".php"; } $user = new user; echo ($user->get_name()); ?>
  6. I am trying to delete a row from my table by the following query $sql = mysql_query("DELETE FORM products WHERE id = '.$yesdelete."' LIMIT 1") or die(mysql_error()); but it gives the following mysql error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = '5' LIMIT 1' at line 1 The same error is coming in phpmyadmin. Please somebody help me.
  7. I am opening my pages but they do not open and an error comes of problem in loading pages. Here is the code <?php session_start(); if(!isset($_SESSION['manager'])) { header("Location: admin_login.php"); exit(); } //Be sure to check this manager session value exist in the database $id = preg_replace('#[^0-9]#','',$_SESSION['id']); $manager = preg_replace('#[^a-zA-Z0-9]#','',$_SESSION['manager']); $password =preg_replace('#[^a-zA-Z0-9]#','',$_SESSION['manager']); include'../storescripts/connect_to_database.php'; $sql = mysql_query("SELECT * FROM admin WHERE id='$id' AND username='$manager' AND password='$password' LIMIt 1"); $exist = mysql_num_rows($sql); if($exist==0){ echo "Your login account does not exist"; exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>E-Commerce website admin Area</title> <link rel="stylesheet" type="text/css" href="../css/default.css"/> </head> <body> <div id="mainWrapper"> <?php include_once('../templateHeader.php');?> <div align="left" style="margin-left:24px" id="content"> <h2> Hello manager what would you like to do today</h2> <p><a href="inventory.php">Manage Inventory</a></p> <p>Manage Blah blah blah</p> </div> <?php include_once('../templateFooter.php');?> </div> </body> </html> <?php session_start(); if(!isset($_SESSION['manager'])) { header("Location: admin_login.php"); exit(); } ?> <?php if((isset($_SESSION['username']))&&(isset($_SESSION['password']))) { //Be sure to check this manager session value exist in the database $id = preg_replace('#[^0-9]#','',$_SESSION['id']); $manager = preg_replace('#[^a-zA-Z0-9]#','',$_SESSION['username']); $password =preg_replace('#[^a-zA-Z0-9]#','',$_SESSION['password']); include'../storescripts/connect_to_database.php'; $sql = mysql_query("SELECT * FROM admin WHERE id='$id' AND username='$manager' AND password='$password' LIMIt 1"); $exist = mysql_num_rows($sql); if($exist==1){ while($row=mysql_fetch_array($sql)){ $id=$row['id']; } $_SESSION['manager']=$username; $_SESSION['password'] = $password; header("Location: index.php"); exit(); } else{ echo "That information is incorrect, try again by clicking<a href=\"index.php\">here </a>"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>E-Commerce website admin Area</title> <link rel="stylesheet" type="text/css" href="../css/default.css"/> </head> <body> <div id="mainWrapper"> <?php include_once('../templateHeader.php');?> <div align="left" style="margin-left:24px" id="content"> <h2> Login Here</h2> <table width="529" border="1" style="margin-left:24px"> <tr> <form id="form1" name="form1" method="post" action="admin_login.php"> <td>Enter name </td> <td><input name="username" type="text" id="username" maxlength="50" /></td> </tr> <tr> <td>Enter password </td> <td><input type="password" name="password" id="password" /></td> </tr> <tr> <td colspan="2"><form id="form2" name="form2" method="post" action=""> <input type="submit" name="button" id="button" value="LogIn" /> </form></td> </tr> </table> <p> </p> </div> <?php include_once('../templateFooter.php');?> </div> </body> </html> I am not getting where I am going wrong
  8. It returns true for the valid user but does not convert this object to array.
  9. I am opening a connection with mysqli and passing the returning object to another function which returns the array of the object passed but it is not giving correct result. Here is the code: function convert_to_array($arrObj){ $res_array = array(); for ($count=0; $row = $arrObj->fetch_assoc(); $count++){ $res_array[$count] = $row; } return $res_array; } function getUser($email,$pass) { $conn = db_connect(); $query ="select * from users where Password='".$pass."' and Email='".$email."'"; $result = @$conn->query($query); $num = @$result->num_rows; if($num==0) echo "NoT OK"; else{ echo "OK"; $result = convert_to_array($result); echo ("$num"); return $result; }function getUser($email,$pass) { $conn = db_connect(); $query ="select * from users where Password='".$pass."' and Email='".$email."'"; $result = @$conn->query($query); $num = @$result->num_rows; if($num==0) echo "NoT OK"; else{ echo "OK"; $result = convert_to_array($result); echo ("$num"); return $result; }
  10. I've installed the ziplib from http://zziplib.sourceforge.net/ link but it does not have php_zip.dll since I want to create zip file of my files.
  11. Hi, I want to add another file on the same form if a user wants to upload more than one files to his directory. Can anybody suggest how to do it. Thanx. <?php [color=red]if($_POST['Submit'])header("Location: zipCreate.php") elseif($_POST['addFile']){ echo "";[/color] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="form2" id="form2"> <div align="center" style="background-color:#006666; font-weight:bold; color:#33FF99;">CREATING ZIP FILE</div> <p>Choose a File to add to zip <input type="file" name="file" /> <input name="addFile" type="submit" id="addFile" style="background-color:#006666; border: 1px; color: #33FF99; font-family: 'Times New Roman', Times, serif; font-weight: bold; font-size: 16px;" value="Add File" align="absmiddle" /> </p> <p> <input align="absmiddle" style="background-color:#006666; border: 1px; color: #33FF99; font-family: 'Times New Roman', Times, serif; font-weight: bold; font-size: 16px;"type="submit" name="Submit" value="Upload File" /> </p> </form> </body> </html> I am having two submit buttons one is for adding more files and another one is for Uploading the files. Then I want to make a zip file of all the uploaded files and save it on the server.
  12. my gd lib is enabled still not working I think working imagettfbox is not working.
  13. they are in the same location.
  14. I've taken this eg from php manual site for displaying txt on image wonder why it is not working <?php // Create a 300x150 image $im = imagecreatetruecolor(300, 150); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); // Set the background to be white imagefilledrectangle($im, 0, 0, 299, 299, $white); // Path to our font file $font = './arial.ttf'; // First we create our bounding box for the first text $bbox = imagettfbbox(10, 45, $font, 'Powered by PHP ' . phpversion()); // This is our cordinates for X and Y $x = $bbox[0] + (imagesx($im) / 2) - ($bbox[4] / 2) - 25; $y = $bbox[1] + (imagesy($im) / 2) - ($bbox[5] / 2) - 5; // Write it imagettftext($im, 10, 45, $x, $y, $black, $font, 'Powered by PHP ' . phpversion()); // Create the next bounding box for the second text $bbox = imagettfbbox(10, 45, $font, 'and Zend Engine ' . zend_version()); // Set the cordinates so its next to the first text $x = $bbox[0] + (imagesx($im) / 2) - ($bbox[4] / 2) + 10; $y = $bbox[1] + (imagesy($im) / 2) - ($bbox[5] / 2) - 5; // Write it imagettftext($im, 10, 45, $x, $y, $black, $font, 'and Zend Engine ' . zend_version()); // Output to browser header('Content-Type: image/png'); imagepng($im); imagedestroy($im); ?>
  15. It is not showing my second drop down list.
  16. In the followinfg code I want to show second drop down list when a choice is selected from the first drop down list. Ca'nt find what the problem is. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function showSecond(str) { var xmlHttp ; if(window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else { xmlHttp= new ActivXObject("Microsoft.XMLHTTP"); } if(xmlHttp.readystate==0 && xmlHttp==200){ document.getElementById("second").innerHTML = xmlHttp.responseText; } xmlHttp.open("GET", "showCity.php?q="+str,true); xmlHttp.send(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Showing Cities</title> </head> <body> <form> Select the country <select name ="country" onchange=showSecond(this.value)> <option value="Pakistan">Pakistan</option> <option value="Iran">Iran</option> <option value="India">India</option> <option value="England">England</option> </select> <p> <span id="second"> </span></p> </form> </body> </html> </body> </html>
  17. in the following code I am unable to understand the purpose of @ function get_categories(){ //query database for a list of categories $conn = db_connect(); $query ="select catid, catname from categories"; $result = @$conn->query($query); if (!$result){ return false; } $num_cats = @$result->num_rows; if($num_cats==0) { return false; } $result = db_result_to_array($result); return false; } function db_result_to_array($result) { $res_array = array(); for ($count=0; $row = $result->fetch_assoc(); $count++){ $res_array[$count] = $row; } return $res_array; }
  18. I want to display my records in form of 5 rows and then want to display a Next click for other 5 records and so on until all the records are displayed. Can any body give me an idea.
  19. I am unable to execute mysql_num_rows properly in this program. <?php $link=mysql_connect("localhost","root",""); $db = mysql_select_db("myDB",$link); $result = mysql_query("SELECT * FROM jobs WHERE jobType=abc"); $num = mysql_num_rows($result); echo "Found $num records"; ?> error is mysql_num_rows() expects parameter 1 to be resource
  20. narjis

    help req

    Can the database generate unique id's and then i can show that job id to the client
  21. I am making an ecommerce website for that I want to generate special keys for jobId unique for each client.Shall I use curl class for that and where should I initialize it.
  22. narjis

    query

    I am making an ecommerce website for that I want to generate special keys for jobId unique for each client.Shall I use curl class for that and where should I initialize it.
  23. narjis

    Help me

    Have you seen the example given on php manual website which is as follows: <?php $text = "\t\tThese are a few words ... "; $binary = "\x09Example string\x0A"; $hello = "Hello World"; var_dump($text, $binary, $hello); print "\n"; $trimmed = trim($text); var_dump($trimmed); $trimmed = trim($text, " \t."); var_dump($trimmed); $trimmed = trim($hello, "Hdle"); var_dump($trimmed); // trim the ASCII control characters at the beginning and end of $binary // (from 0 to 31 inclusive) $clean = trim($binary, "\x00..\x1F"); var_dump($clean); ?> The last trim gives correct result but when I change it to $trimmed = trim($hello, "HdWr"); var_dump($trimmed); it doesnot strip off W. I am attachoing the code here with. [attachment deleted by admin]
  24. narjis

    Help me

    in the first code i am getting the same string and in the second one W of World string is not trimmed off.
  25. narjis

    query

    How can we add images in our tables and what should be it's datatype?
×
×
  • 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.