Jump to content

debmc99

Member
  • Posts

    58
  • Joined

  • Last visited

Everything posted by debmc99

  1. debmc99

    Php Sidebar Error

    Thanks Ben! It worked great!
  2. debmc99

    Php Sidebar Error

    Thanks Ben, I think I am almost there. But now I get this error. Do you see the problem? Parse error: syntax error, unexpected '<' in /home/xxxxx/www/www/wp-content/themes/theme-name/sidebar-df.php on line 8 <div class="m-blog-side"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home-Sidebar-Widgets") ) : ?> <div class="side-cats2"> <div class="sider-22"> <?php <div class="woodo"> <div class="ad_callout" onclick="location.href='/blog/register/';"> <!--<h2>Call To Action!</h2>--> <p>Subscribe to the blog for insider information!</p> </div><!-- #ad_callout --> </div> ?> <div class="woodo"> <?php /* sidebarlogin(); */ ?> </div> </div> </div> <?php endif; ?> </div></div>
  3. debmc99

    Php Sidebar Error

    Thanks Ben, Is there a way I can disable that thing all together? I think it was from a plugin. I am not sure. It is happening in the sidebar. Can you tell me how to disable the sidebar in the functions.php page?
  4. debmc99

    Php Sidebar Error

    Hello, not sure if this post should be here or WordPress. I migrated a WordPress site (an ordeal in itself) to a new server and new domain name. The theme has a sidebar with a login that is throwing this error: Fatal error: Call to undefined function sidebarlogin() in /home/domain_name/www/www/wp-content/themes/theme_name/sidebar-df.php on line 17 Can someone point me in the right direction? Here is the sidebar-df.php code below. Any help would be appreciated! <div class="m-blog-side"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home-Sidebar-Widgets") ) : ?> <div class="side-cats2"> <div class="sider-22"> <?php /* <div class="woodo"> <div class="ad_callout" onclick="location.href='/blog/register/';"> <!--<h2>Call To Action!</h2>--> <p>Subscribe to the blog for insider information!</p> </div><!-- #ad_callout --> </div> */ ?> <div class="woodo"> <?php sidebarlogin(); ?> </div> </div> </div> <?php endif; ?> </div></div> </div> </div>
  5. Hello, I have two responsive WordPress themes. However, neither resize when I touch the screen to zoom in or out. However, when I look at some sites on my tablet, they have that capability. Does anyone know what that capability to resize by pulling or dragging on the screen is called? Thanks!
  6. Yes, but the date needs to appear on the coupon automatically, for example, if the user gets redirected to the coupon on 7/14/2012, the coupon needs to show 7/14/2012. Not sure how to make that happen. Actually, maybe it is not an image that is displayed on coupons I have seen in some plugins, but maybe a form with text in between fields. So it will look like a coupon but it's really another form. What do you think?
  7. Hello Ben, Yes, I am building a website that just needs a single coupon. I am using the Formidable Pro plugin to create a short online survey. Once the survey is submitted, the user is directed to a page where they can right click the coupon and save it to their phone. The problem is that I need them to be able to email the coupon to themselves to print later if they want to. So your suggestion of "email to a friend" might work. The other problem is I need the date displayed somewhere near the coupon because it will only be valid for a certain time, like 30 days, next visit, etc. So my problem is if they right click the .png and save it, I lose the date that is displayed on the page. I know it is not super complicated but I can't find something that will solve both problems. The coupon is supposed to be saved on mobile phones, so I need the saved image to include the date, and I also need to offer the option of printing it later. I hope that makes sense. Any ideas you have would be extremely welcome. Thank you!
  8. Hello! I am building a client site with WordPress and I am looking all over for a simple coupon plugin. I have looked everywhere. I don't need anything with affiliate links, or Groupon type offers. I just need to make an coupon (.png file) available on the site and then have the ability to print or email it. Any suggestions would be helpful. I have been looking for 3 days and have not found anything that will work.
  9. Hi, sorry, this is a WordPress issue. Once I create a Home link on for the navigation, "Home" become the title for the homepage, and I was wondering where the php code is to edit it. I've checked header.php but can't find I need to edit the code.
  10. Hello, In Wordpress, does anyone know how to edit the default H1 tag titles on pages and posts? I've checked header.php but can't find the code. Any help would be appreciated!
  11. Hello, I don't really like Facebook and have stayed away from it. But I have clients that want me to set up pages for them and not profiles. I find that each time I try to set up a page for a client, Facebook asks me to log in. I have deleted all the cookies I can find on my computer but nothing works. Does anyone know how to set up accounts for clients? Any help would be appreciated. Thank you.
  12. Hello, I have a client who wants his email address on his website where you can click on it to contact him. He did not want a contact form. I advised him against the email address because I thought it would just get harvested and he'd get a lot of SPAM. I would just like to know if you would go ahead and add the email address since the client wants it, or would you make the email address not active or something. Just wondering. Thank you.
  13. Hello, I have a question about my code below which allows clients to upload files. In testing the code as it is, what happens is the error message does not display when I try to upload an incorrect file type, nor does the "File uploaded successfully" message display when I upload an acceptable file type. The files actually do get uploaded but you'd never know because but you automatically get redirected back to members.php which is where you start to upload a file in the first place. However, if I take out everything before the line "// begin Dave B's Q&D file upload security code" everything works fine. Is there a way to get the success or error message to display and I guess include a link to then get back to the members.php page without messing up the login part? Any help on this would be very much appreciated. Thank you very much. <?php /* * PROCESSFILE.PHP * Password protected area to process members' uploaded files */ //start session session_start(); include("includes/config.php"); /* * This section below checking if user is logged in/checking for inactivity * may be best put in a reusable function so it is easily reused/updated */ // check that the user is logged in if (!isset($_SESSION['username'])) { header("Location: login.php?unauthorized"); } //check that the user is an admin else if (!is_ceoadmin()) { header("Location: members.php"); } // check for inactivity if (time() > $_SESSION['last_active'] + $config['session_timeout']) { // log out user session_destroy(); header("Location: login.php?timeout"); } else { // update the session variable $_SESSION['last_active'] = time(); } // begin Dave B's Q&D file upload security code $allowedExtensions = array("doc","docx","xls","xlsx","pdf","jpg","jpeg","gif","png"); foreach ($_FILES as $file) { if ($file['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { die($file['name'].' Sorry, this is an invalid file type!<br/>'. '<a href="javascript:history.go(-1);">'. '<&lt Go Back</a>'); } } } // end Dave B's Q&D file upload security code $uploadDir = "./uploaded/"; // Check if file has been uploaded if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $filePath = $uploadDir . $fileName; // get the file extension first $ext = substr(strrchr($fileName, "."), 1); // make the random file name $randName = md5(rand() * time()); // and now we have the unique file name for the upload file $filePath = $uploadDir . $randName . '.' . $ext; $result = move_uploaded_file($tmpName, $filePath); if (!$result) { echo "Error uploading file"; exit; } // Connect to the database $dbLink = new mysqli('I removed the db info for this post'); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $query = "INSERT INTO uploadpath (name, type, size, path ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath')"; mysqli_query($dbLink, $query) or die('Error, query failed : ' . mysqli_error($dbLink)); // close db connection $dbLink->close(); echo "<p> The file, $fileName, has been successfully uploaded.</p>"; } ?>
  14. That totally worked! Thank you so much!
  15. Yes, I noticed that, but it is like that in the phplogin - parts 17 and 18 project file - register.php, so I wasn't sure. Do I just close it?
  16. Here is the register.php code: <?php /* * REGISTER.PHP * Register New Members */ //start session / load configs session_start(); include('includes/config.php'); include('includes/db.php'); /* * This section below checking if user is logged in/checking for inactivity * may be best put in a reusable function so it is easily reused/updated */ // check that the user is logged in if (!isset($_SESSION['username'])) { header("Location: login.php?unauthorized"); } //check that the user is an admin else if (!is_ceoadmin()) { header("Location: members.php"); } // check for inactivity if (time() > $_SESSION['last_active'] + $config['session_timeout']) { // log out user session_destroy(); header("Location: login.php?timeout"); } else { // update the session variable $_SESSION['last_active'] = time(); } // form defaults $error['alert'] = ''; $error['user'] = ''; $error['type'] = ''; $error['pass'] = ''; $error['pass2'] = ''; $input['user'] = ''; $input['type'] = ''; $input['pass'] = ''; $input['pass2'] = ''; if (isset($_POST['submit'])) { $input['user'] = htmlentities($_POST['username'], ENT_QUOTES); $input['type'] = htmlentities($_POST['type'], ENT_QUOTES); $input['pass'] = htmlentities($_POST['password'], ENT_QUOTES); $input['pass2'] = htmlentities($_POST['password2'], ENT_QUOTES); // create select options $select = '<option value="">Select an option</option'; $stmt = $mysqli->prepare("SELECT id, name FROM permissions"); $stmt->execute(); $stmt->bind_result($id, $name); // for more information, see http://www.php.net/manual/en/mysqli-stmt.bind-result.php while ($stmt->fetch()) { $select .= "<option value='" . $id . "'"; if ($input['type'] == $id) { $select .= "selected='selected'"; } $select .= ">" . $name . "</option"; } $stmt->close(); // process form if ($_POST['username'] == '' || $_POST['password'] == '' || $_POST['password2'] == '' || $_POST['type'] == '') { // both fields need to be filled in if ($_POST['username'] == '') { $error['user'] = 'required!'; } if ($_POST['type'] == '') { $error['type'] = 'required!'; } if ($_POST['password'] == '') { $error['pass'] = 'required!'; } if ($_POST['password2'] == '') { $error['pass2'] = 'required!'; } $error['alert'] = 'Please fill in required fields!'; // show form include('views/v_register.php'); } else if ($_POST['password'] != $_POST['password2']) { // both password fields need to match $error['alert'] = 'Password fields must match!'; // show form include('views/v_register.php'); } else { // get and clean data from form $input['user'] = $_POST['username']; $input['pass'] = $_POST['password']; $input['pass2'] = $_POST['password2']; // insert into database if ($stmt = $mysqli->prepare("INSERT members (username, type, password) VALUES (?,?,?)")) { $stmt->bind_param("sss", $input['user'], $input['type'], md5($input['pass'] . $config['salt'])); $stmt->execute(); $stmt->close(); // add alert and clear form values $error['alert'] = 'Member added successfully!'; $input['user'] = ''; $input['type'] = ''; $input['pass'] = ''; $input['pass2'] = ''; // show form include('views/v_register.php'); } else { echo "ERROR: Could not prepare MySQLi statement."; } } } else { // create select options $select = '<option value="">Select an option</option'; $stmt = $mysqli->prepare("SELECT id, name FROM permissions"); $stmt->execute(); $stmt->bind_result($id, $name); while ($stmt->fetch()) { $select .= "<option value='" . $id . "'>" . $name . "</option"; } $stmt->close(); // show form include('views/v_register.php'); } // close db connection $mysqli->close();
  17. Hello, Yes, I had the php code replacing the "mmm" parts. The options for the "Select" drop down list should be coming from this, right? <?php echo $select; ?> Here is the current CSS: body { font-family: Arial; margin:0; } h1 { background: #1B2835; padding: 20px; font-size: 1.5em; color: white; margin: 0 0 20px 0; } #content {padding: 0 20px; } #content a {padding: 0 20px;} .required { color: red; font-size: .8em; clear: both; padding-top: 20px; } .error { float: left; color: red; display: block; padding: 4px 0 0 10px; font-size:.8em; } .alert { background: #feff96; border: 1px solid yellow; padding: 8px; margin-bottom: 20px; } form { overflow: auto; } label {float: left; width: 180px; display: block;} input, select {width: 180px; padding: 2px; float: left; } input.submit { float: left; clear: both; width: 80px; margin-top: 20px; } ol.form { margin:0; padding:0; overflow:hidden; } ol.form li { list-style:none; padding:0 0 6px 0; overflow:hidden; clear:both; float:left; } Here is the current HTML. It is weird because the first password field doesn't even display in IE, only Password (again)does. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Register Member</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow"> <link href="css/register_style.css" media="screen" rel="stylesheet" type="text/css"> </head> <body> <h1>Register Member</h1> <div id="content"> <form action="" method="post"> <ol class="form"> <li><label for="username">Username: *</label> <input type="text" name="username" value="<?php echo $input['user']; ?>"><div class="error"><?php echo $error['user']; ?></div></li> <li><label for="type">Member Type: *</label> <select name="type"> <?php echo $select; ?> </select> <div class="error"><?php echo $error['type']; ?></div></li> <li><label for="password">Password: *</label> <input type="password" name="password" value="<?php echo $input['pass']; ?>"><div class="error"><?php echo $error['pass']; ?></div></li> <li><label for="password2">Password (again): *</label> <input type="password" name="password2" value="<?php echo $input['pass2']; ?>"><div class="error"><?php echo $error['pass2']; ?></div></li> <li><p class="required">* required fields</p></li> <li><input type="submit" name="submit" class="submit" value="Submit"></li> </ol> </form> <p style="clear:both;"><a href="members.php">Back to member's page</a> | <a href="change_password.php">Change Password</a> | <a href="logout.php">Log Out</a></p> </div> </body> </html> Thank you for your help. I have put hours into this and I have no idea what to try next.
  18. The only error I am getting refers to this: <select name="type"> mmm </select> (end tag for "SELECT" which is not finished) but everything else is valid. The CSS is valid too.
  19. Hello, I am sorry, but this is still not working. Actually, I am using IE8. When I add the php code the alignment is off again and the drop down select menu displays an actual option rather than "select an option". It is so weird because virtually the exact same CSS styles work fine for the other pages, including a contact form with drop down menus. I know you are all busy but if I could get any further advice I would really appreciate it and I can finally finish this project. Would adding the php have anything to do with the alignment issue?
  20. Hello, I completed the PHP Login tutorial. Everything worked fine when I tested it in Firefox. However, the form used to register new members (register.php) is only showing 3 of the 4 form fields and they are not lining up vertically and floated next to the labels as they should be. I am really stumped because it works fine in FF. And even if I download the style.css source file it still is out of alignment in IE only. Can anyone see what I am doing wrong? I would appreciate any advice. Thank you. Here is the css: body { font-family: Arial; margin:0; } h1 { background: #1B2835; padding: 20px; font-size: 1.5em; color: white; margin: 0 0 20px 0; } #content {padding: 0 20px; } #content a {padding: 0 20px;} .required { color: red; font-size: .8em; clear: both; padding-top: 20px; } .error { float: left; color: red; display: block; padding: 4px 0 0 10px; font-size:.8em; } .alert { background: #feff96; border: 1px solid yellow; padding: 8px; margin-bottom: 20px; } form { overflow: auto; } label {float: left; clear: both; width: 180px; display: block;} input, select {width: 180px; padding: 2px; margin-bottom: 4px; float: left;} input.submit { float: left; clear: both; width: 80px; margin-top: 20px; } Here is the form: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Register Member</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="robots" content="noindex, nofollow"> <link href="css/register_style.css" media="screen" rel="stylesheet" type="text/css"> </head> <body> <h1>Register Member</h1> <div id="content"> <form action="" method="post"> <div> <?php if ($error['alert'] != '') { echo "<div class='alert'>".$error['alert']."</div>"; } ?> <label for="username">Username: *</label> <input type="text" name="username" value="<?php echo $input['user']; ?>"><div class="error"><?php echo $error['user']; ?></div> <label for="type">Member Type: *</label> <select name="type"> <?php echo $select; ?> </select> <div class="error"><?php echo $error['type']; ?></div> <label for="password">Password: *</label> <input type="password" name="password" value="<?php echo $input['pass']; ?>"><div class="error"><?php echo $error['pass']; ?></div> <label for="password2">Password (again): *</label> <input type="password" name="password2" value="<?php echo $input['pass2']; ?>"><div class="error"><?php echo $error['pass2']; ?></div> <p class="required">* required fields</p> <input type="submit" name="submit" class="submit" value="Submit"> </div> </form> <p><a href="members.php">Back to member's page</a> | <a href="change_password.php">Change Password</a> | <a href="logout.php">Log Out</a></p> </div> </body> </html>
  21. Hello, If I go to http://www.killersites.com/university/user-login.php and login as usual, I get the error message: "Your subscription has expired. Please Purchase a New Subscription to enter to Killersites University." This message appears here: http://www.killersites.com/university/user-login.php?f=2 It's weird because I do have a subscription. This did not happen previously. And even though it shows that expired subscription message it is still logging me in because it says "Hello my email address" in the top right corner. After that I can log out and it says: You have successfully logged out..., etc. I don't have anything bookmarked. And I cleared my browsing history and it still happened. Again, I am still able to access the videos so I am happy but I am just letting you know.
  22. Hello, This is my second month of the subscription to KU and I notice that when I login I get this message: "Your subscription has expired. Please Purchase a New Subscription to enter to Killersites University." Here's the page with the error: http://www.killersites.com/university/user-login.php?f=2 However, I still get full access to the videos and it even says "Hello my email address" at the top of the user-login.php page. Just letting you know.
×
×
  • Create New...