Jump to content

shwetapandit

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by shwetapandit

  1. I am using WPSQT plugin in my blog site .I code some files in PHP also.how to add that files in plugin files.
  2. i tried to search but can't get satisfy.what is the exact difference b/w shopping cart and e-commerce website.Thanks in advance.....
  3. hi..... As i am newbie to wordpress.i may be wrong.but can't find.Below is my files: cutom_page.php <!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> <style type='css'> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" /> <?php if(is_page_template('custom_page.php')) :?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" media="screen" /> <?php endif;?> </style> </head> <body> <?php /** * Template Name:Custom Page * The main template file * * This is the most generic template file in a WordPress theme and one of the * two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * For example, it puts together the home page when no home.php file exists. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?> <div id="container"> <div id="header"> <h1>Main Title of Web Page</h1></div> <div id="menu"> <b>Menu</b><br> HTML<br> CSS<br> JavaScript</div> <div id="content"> Content goes here</div> <div id="footer"> Copyright©</div> </div> </body> </html> style.css /* CSS Document */ /* Theme Name: Demo Theme URI: http://example.com/Demo/ Description: Demo Author: John Doe Author URI: http://example.com Version: 1.0.0 * ---------------------------------------------------------------------------- */ h1{color:#00FF99; background-color:#00FF66; font:Verdana, Arial, Helvetica, sans-serif; font-size:16px; } p{ color:#FFFF33; background-color:#CCCCCC; } #footer{ background-color:#FFA500; clear:both; text-align:center; } #main{ width:1000px; height:1000px; } #header{ background-color:#FFA500; height:100px; } #menu{ background-color:#FFD700; height:800px; width:200px; float:left; } #content{ background-color:#EEEEEE; height:800px; width:800px; float:left; } header.php <?php /** * The Header template for our theme * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 */ ?><!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?>> <![endif]--> <!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?>> <![endif]--> <!--[if !(IE 7) | !(IE ]><!--> <html <?php language_attributes(); ?>> <!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width"> <title><?php wp_title( '|', true, 'right' ); ?></title> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" /> <?php if(is_page_template('custom_page.php')) :?> <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css" media="screen" /> <?php endif;?> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page" class="hfeed site"> <header id="masthead" class="site-header" role="banner"> <a class="home-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> </a> <div id="navbar" class="navbar"> <nav id="site-navigation" class="navigation main-navigation" role="navigation"> <h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3> <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> <?php get_search_form(); ?> </nav><!-- #site-navigation --> </div><!-- #navbar --> </header><!-- #masthead --> <div id="main" class="site-main"> Where i am wrong plz suggest.Thanks in advance...........
  4. where to link and how to link style.css in my custom page template in wordpress.plz reply
  5. as i m newbee to wordpress can anyone tell me what i have to study or my task next. i have installed and upload wordpress i understand admin side and user side functionalite worked on dashboard understand folder structure and file structure of wordpress create a child theme of twenty.thirteen what's next move now
  6. <html> <head> <script src="http://localhost:81/assignment/ckeditor/ckeditor.js"></script> </head> <body> <div style='padding-top:50px'> CKEDITOR: <div> <div> <?php $conn=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); $p_id=$_GET['p_id']; $query=mysql_query("SELECT p_content FROM admin_page WHERE p_id='$p_id'")or die(mysql_error()); $row=mysql_fetch_array($query,MYSQL_ASSOC); ?> <textarea cols="80" id="p_content" name="p_content" rows="10" > <?php echo $row['p_content']; ?> </textarea> </div> <script type='text/javascript'> CKEDITOR.replace( 'p_content' ); </script> </body> </html>
  7. i did it....... <html> <head> <script src="../ckeditor.js"></script> </head> <?php $conn=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); print_r($_GET); $p_id=$_GET['p_id']; $query=mysql_query("SELECT p_content FROM admin_page WHERE p_id='$p_id'")or die(mysql_error()); $row=mysql_fetch_array($query,MYSQL_ASSOC); ?> <textarea cols="80" id="p_content" name="p_content" rows="10" > <?php echo $row['p_content']; ?> </textarea> //print_r ($row['p_content']); </html>
  8. i did it now........ <html> <head> <script src="../ckeditor.js"></script> </head> <?php $conn=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); print_r($_GET); $p_id=$_GET['p_id']; $query=mysql_query("SELECT p_content FROM admin_page WHERE p_id='$p_id'")or die(mysql_error()); $row=mysql_fetch_array($query,MYSQL_ASSOC); ?> <textarea cols="80" id="p_content" name="p_content" rows="10" > <?php echo $row['p_content']; ?> </textarea> //print_r ($row['p_content']); </html>
  9. how to display the textarea content from database using ckeditor. i did it with php as below and it works perfect but how to do same in ckeditor.Any idea.......: <html> <head> //<script src="../ckeditor.js"></script> </head> <?php $conn=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); print_r($_GET); $p_id=$_GET['p_id']; $query=mysql_query("SELECT p_content FROM admin_page WHERE p_id='$p_id'")or die(mysql_error()); $row=mysql_fetch_array($query,MYSQL_ASSOC); print_r ($row['p_content']); ?> </html>
  10. thanks for help. i got it now.But how to display the textarea content from database using ckeditor.
  11. If ANyone uses CK editor then plz help me i m in great trouble.i download ck editor from the site and after unzip the folder paste all the files where my PHP files are.But can't find how to use it.any help is greatly appreciated.
  12. whwn i tried to print $_GET array it does not print anything while i am sending p_id through URL.Why it is so...... <?php $conn=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); $query=mysql_query("SELECT * FROM admin_page")or die(mysql_error()); //$row=mysql_fetch_array($query); echo "<table width='500' cellspacing='0' cellpadding='0' border='0'>"; echo "<tr align='centre' colspan='1' rowspan='1'><th>p_name</th><th>p_link</th><th>p_content</th></tr>"; while($row=mysql_fetch_array($query)){ $p_id=$row['p_id']; echo "<tr><td>"; $link=$row['p_name']; print "<a href=".'show_page.php?p_id=$p_id'.">" .$row['p_name'] . "</a><br>"; echo "</td><td>"; echo $row['p_link']; echo "</td></tr>"; } echo "<tr><td>"; echo "</table>"; print_r($_GET); ?>
  13. there is some problem with my code but i couldn't find it.its telling invalid file while i tried with .jpg file which is allowed extension in this file any help is greatly appreciated......... html code: <html> <body> <form action="upload_filee.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file"><br> <input type="submit" name="submit" value="Submit"> </form> </body> </html> upload_filee.php: <?php $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); print_r($_FILES); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png")) //&& ($_FILES["file"]["size"] < 20000000) && in_array($extension, $allowedExts)) { print_r($_FILES); if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } } else { echo "Invalid file"; } ?>
  14. why unexpected end of file on line 49: <html> <?php session_start(); if(isset($_POST['submit'])){ if (isset($_SESSION['email'])) { $uid=$_SESSION['uid']; $con=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); $add1=$_POST['add1']; $add2=$_POST['add2']; $city=$_POST['city']; $state=$_POST['state']; $country=$_POST['country']; if (isset($_POST['set'])){ $sett=$_POST['set']; } //check if the default address is already set. $check = mysql_query("SELECT uid FROM address WHERE uid = '$uid' and sett='1' ") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the default already set, it gives an error if ($check2 != 0) { die('Sorry, the default is already set.would you like to change it'); $display_block=<<<END_OF_BLOCK <form action="update.php" method="POST"> <h2>Would you like to change your default address</h2> yes:<input type="radio" name="update" value="1"><br/> No:<input type="radio" name="update" value="0"><br/> <input type="submit" value="submit" name="submit"> </form> END_OF_BLOCK; } else if($check2 == 0){ mysql_query("INSERT INTO address (uid, add1, add2, city, state, country ,sett ) VALUES ('$uid', '$add1','$add2' ,'$city' ,'$state' ,'$country' , '$sett' )") or die(mysql_error()); echo "Your address get saved in our Database"; echo "<br/>"; } } } ?> <a href="logout.php">logout</a><br/> <a href="add_address.php">Would you like to add another address</a><br/> <a href="default.html">Next Page</a> </html>
  15. this is my html file.when i am submitting the file it shows : 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 'set) VALUES ('', '11','11' ,'nashik' ,'mh' ,'india', '1' )' at line 1 why it is so.any suggestions........ add_address.html <html> <head> <title>Add Address</title> </head> <body> <table border="1" cellspacing="2" cellpadding="0"> <tr><td> <h2>Add Address here</h2></td></tr> <form action="add_address.php" method="POST"> <tr><td> Add1:<input type="text" name="add1" id="add1"><br/> </td></tr> <tr><td> Add2:<input type="text" name="add2" id="add2"><br/> </td></tr> <tr><td> City:<input type="text" name="city" id="city"><br/> </td></tr> <tr><td> State:<input type="text" name="state" id="state"><br/> </td></tr> <tr><td> Country:<input type="text" name="country" id="country"><br/> </td></tr> <tr><td> <h2>would you like to make it default address</h2> </td></tr> <tr><td> Yes:<input type="radio" name="set" value="1" id="set"><br/> </td></tr> <tr><td> No:<input type="radio" name="set" value="0" id="set"><br/> </td></tr> <tr><td> <input type="submit" name="submit" value="submit"><br/> </td></tr> </form> </body> </html> add_address.php <?php session_start(); if(isset($_POST['submit'])){ if (isset($_SESSION['email'])) { $uid=$_SESSION['uid']; $con=mysql_connect("localhost","root","")or die(mysql_error()); mysql_select_db("regis")or die(mysql_error()); $add1=$_POST['add1']; $add2=$_POST['add2']; $city=$_POST['city']; $state=$_POST['state']; $country=$_POST['country']; if (isset($_POST['set'])){ $set=$_POST['set']; } mysql_query("INSERT INTO address (uid, add1, add2, city, state, country, set) VALUES ('$uid', '$add1','$add2' ,'$city' ,'$state' ,'$country', '$set' )") or die(mysql_error()); echo "Your address get saved in our Database"; echo "<br/>"; }} ?> <a href="logout.php">logout</a><br/> <a href="add_address.php">Would you like to add another address</a><br/> <a href="default.html">Next Page</a>
  16. i got undefined var errors on line no 26,27,28 for variables fname,lname,phone.how they can be undefined they are getting retrived by mysql.how to remove these errors. <?php session_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="regis"; // Database name $tbl_name="regis"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); if(isset($_SESSION['email'])) $email=$_SESSION['email']; { $query="SELECT fname,lname,phone,email FROM regis WHERE email='$email'"; $result=mysql_query($query); $num=mysql_fetch_array($result);} ?> <table width="600" cellpadding="10" cellspacing="0" border="2"> <tr align="center" valign="top"> <td align="center" colspan="1" rowspan="1"> <form action="update.php" method="POST"> <input type="hidden" name="email" value="<?php echo "$email"?>"> <input type="text" name="fname" value="<?php echo "$fname"?>"> <input type="text" name="lname" value="<?php echo "$lname"?>"> <input type="text" name="phone" value="<?php echo "$phone"?>"> <input type="submit" value="submit"> </form></td></tr></table>
  17. the session var email is not saves as when ai am using if-else to check session isset it goes to else clause why it is so and how i can save my session. <?php session_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="regis"; // Database name $tbl_name="regis"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $email=$_POST['email']; $pass=$_POST['pass']; // To protect MySQL injection (more detail about MySQL injection) $email = stripslashes($email); $pass = stripslashes($pass); $email = mysql_real_escape_string($email); $pass = mysql_real_escape_string($pass); $sql="SELECT * FROM $tbl_name WHERE email='$email' and pass='$pass'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $email and $pass, table row must be 1 row if($count==1){ $_session['email']="$email"; else { echo "Wrong Username or Password"; } if(isset($_SESSION['email'])) echo "amit"; else echo "other"; } ?>
  18. i know the algorithm but did not get the correct answer that how can i sort the array without using the built-in functions in php.plz help.
  19. i understand now.its solved.its not inserted becoz of my mistake.sorry
  20. the form get's executed correctly n also shows the expected message(echo). but it does not insert any value in database. why it is so.PLZ help. <?php // Connects to your Database mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("simple_login") or die(mysql_error()); //This code runs if the form has been submitted if (isset($_POST['submit'])) { //This makes sure they did not leave specific fields blank if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { die('You did not complete all of the required fields'); } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the username '.$_POST['username'].' is already in use.'); } // this makes sure both passwords entered match if ($_POST['pass'] != $_POST['pass2']) { die('Your passwords did not match. '); } // here we encrypt the password and add slashes if needed $_POST['pass'] = md5($_POST['pass']); if (!get_magic_quotes_gpc()) { $_POST['pass'] = addslashes($_POST['pass']); $_POST['username'] = addslashes($_POST['username']); } //post date to variables $username= $_POST['username']; $pass= $_POST['pass']; $firstname= $_POST['firstname']; $middlename= $_POST['middlename']; $lastname= $_POST['lastname']; $email= $_POST['email']; if(isset($_POST['designation'])){ $designation=$_POST['designation'];} if (isset($_POST['gender'])){ $gender = $_POST['gender'];} if (isset($_POST['tskills'])) { $tskills=$_POST['tskills'];} // now we insert it into the database $insert = "INSERT INTO users (username, password,firstname,middlename,lastname,gender,tskills) VALUES ('$username' , '$pass' , '$firstname' , '$middlename' , '$lastname' , '$gender' , '$tskills' , '$designation' , '$email')"; $add_member = mysql_query($insert); ?> <h1>Registered</h1> <p>Thank you, you have registered - you may now login</a>.</p> <?php } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table border="0"> <tr><td> <legend>NAME</legend> FirstName: <input type="text" name="firstname" id="firstname"> <br/> MiddleName:<input type="text" name="middlename" id="middlename"> <br/> LastName: <input type="text" name="lastname" id="lastname"> <br/> </td></tr> <tr><td> <legend>PHYSICAL INFO</legend> Male <input type="radio" id="male" name="gender" value="male"><br/> Female<input type="radio" id="female" name="gender" value="female"><br/> </td></tr> <tr><td> <legend>TECHNICAL SKILLS</legend> <input type="checkbox" name="tskills[]" value="html">html<br/> <input type="checkbox" name="tskills[]" value="css">CSS<br/> <input type="checkbox" name="tskills[]" value="javascript">Javascript<br/> <input type="checkbox" name="tskills[]" value="jquery">Jquery<br/> <input type="checkbox" name="tskills[]" value="php">PHP<br/> <input type="checkbox" name="tskills[]" value="mysql">MySQL<br/> <input type="checkbox" name="tskills[]" value="codeignitor">CodeIgnitor<br/> </td></tr> <tr><td> <legend>CURRENT DESIGNATION</legend> <select name="designation"> <option type="text" value="developer" name="developer" id="developer"> Developer </option> <option type="text" value="designer" name="designer" id="designer"> Designer </option> <option type="text" value="analyst" name="analyst" id="analyst"> Analyst </option> <option type="text" value="manager" name="manager" id="manager"> Manager </option> <option type="text" value="marketing" name="marketing" id="marketing"> Marketing </option> <option type="text" value="trainee" name="trainee" id="trainee"> Trainee </option> </select> </td></tr> <tr><td>Email ID:<input type="email" name="email" id="name"></td></tr></br> <tr><td> <legend>LOGIN DETAILS</legend> <tr><td>Username:</td><td> <input type="text" name="username" maxlength="60"> </td></tr> <tr><td>Password:</td><td> <input type="password" name="pass" maxlength="10"> </td></tr> <tr><td>Confirm Password:</td><td> <input type="password" name="pass2" maxlength="10"> </td></tr> <tr><th colspan=2><input type="submit" name="submit" value="Register"></th></tr> </table> </form> <a href="login.php">PLEASE LOGIN</a><br/> <a href="form.php">FORGET PASSWORD</a> <?php } ?>
  21. this is my file in PHPMailer/test folder location.Plz help <?php $email = $_POST["email"]; $pattern = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z])/'; $email_test = preg_match("$pattern", $email); if($email_test){ include("settings.php"); //FILE WITH THE IMPORTANT MySQL INFORMATION require_once "C:\wamp\www\PHPMailer_5.2.4/class.phpmailer.php"; $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Host = "smtp.gmail.com:587"; $mailer->SMTPsecure='tls'; $mailer->SMTPAuth = TRUE; $mailer->Username = "abc@gmail.com"; // Change this to your gmail adress $mailer->Password = "pass"; // Change this to your gmail password $mailer->From = "abc@gmail.com"; // This HAVE TO be your gmail adress $mailer->FromName = "you temporary password"; // This is the from name in the email, you can put anything you like here $mailer->Body = "This is the your temporary password"; $mailer->Subject = "Temporary password"; $q = mysql_query("SELECT * FROM simple_login WHERE email='".$email."'"); $n = mysql_num_rows($q); $r = mysql_fetch_assoc($q); $mailer->headers = "From: Your Site \r\n"; $mailer->headers.= "Content-type: text/html\r\n"; $mailer->message = "You have requested that you forgot your password.<br> Password: <b>".$r["password"]."<b>"; $mailer->AddAddress("$email"); // This is where you put the email adress of the person you want to mail if(!$mailer->Send()) { echo invalid Email<br/ >'; echo "Mailer Error: " . $mailer->ErrorInfo; } else { echo 'Password sent to <b>'.$email.'</b>';; } ?>
×
×
  • 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.