Jump to content

misheck

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

misheck's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks I will try this on my local machine but what can I use when I need to do it my website host?
  2. I am using wordpress for my website but now I am looking at transfering to a new webhost but I am having difficulties transfering my mysql files. The sql file is 16mb long and when I try insert into phpmyadmin nothing happens and also when I try inserting it using mysql commandline nothing happens again. Is there a way of importing a sql file?
  3. I am trying to put a like and recommend button on my website but I have now only managed to get it to work with IE and not with firefox or flock. I need help with linking the js SDK locally rather than from the website and I am using the xml or fb so that my website speed will not be affected by the app. I need to know how to load the javascript locally rather than from the website, I have downloaded the javascript SDK from the website but I dont know which file to link to. Here is a example I am trying to work on but its only working on IE and not other browsers. I have tried to register to the facebook developer website but its not proceeding to the register section so I cannot post on the site to get help. Here is the example I have tried <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <script src="/xfbml/xfbml.js"></script> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>shout-africa</title> </head> <body> <h1>shout-africa</h1> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: '122975394383945', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script> <fb:like href="www.shout-africa.com" layout="button_count" show_faces="true" width="10" action="like" colorscheme="light"></fb:like> </body> </html>
  4. I am using codeigniter and I am looking for an image upload and resizing plugin that I can easily implement to my project. Can anyone suggest one that I can use. Thanks
  5. I am stuck on completing my first CI website. I need to get the comment counts and article category on my homepage. I have functions already in my models that retrieves this information but they all need an id passed in the function in order to retrieve the correct information for the articles. So I can retrieve both the comment count and category in my article view but I cannot on the homepage because the homepage contains multiple articles from various categories. I dont what addittional information I can post here but I will post my homepage controller and the getcomments model . Homepage function index() { $data['cats'] = $this->MCats->getTopCategories(); //we will replace soon! $data['title'] = "Shout-Africa"; $data['main'] = 'public_home'; $data['featured'] = $this->MPosts->getAllFeaturedPosts(); $data['post'] = $this->MPosts->getAllActivePosts(); $data['comms'] = $this->MComments->getLatestComments(); $this->load->vars($data); $this->load->view('newheader'); $this->load->view('newnav'); $this->load->view('newfeatured'); $this->load->view('newcontent'); $this->load->view('newvideo'); $this->load->view('newrightside'); $this->load->view('newwidget'); $this->load->view('footer'); } the getcomments model function getComments($postid){ $data = array(); $this->db->where('post_id',$postid); $Q = $this->db->get('comments'); if ($Q->num_rows() > 0){ foreach ($Q->result_array() as $row){ $data[] = $row; } } $Q->free_result(); return $data; } Any help is appreciated.
  6. misheck

    mysql date

    I am developing a sample application and would like a user to have a drop down calendar and select a date from there. Does anyone have a work around on inserting a date into Mysql DATE column. My problem is at the moment I have been restricted to entering the date as 2009-01-02 but I am in the UK where we accustommed to entering the date as 02-01-2010. Is there a way I can modify mysql column to take the values that way?
  7. I am using a codeigniter framework and I need to pass to 2 $_POST variables to a function in my models the function is model function-> function new_todo($content) { $date = date('l js \of F Y h:i:s A'); $data = array( 'my_day' => $date , 'content' => $content , 'author' => 'Misheck' ); $this->db->insert('query7',$data); } So originally I was just retrieving one value but now I need to add another value for the author. So in my controller I had this originally controller -> function add_item() { $content = $this->input->post('content'); $this->todo_model->new_todo($content); redirect(''); } So now I will add another $author = $this->input->post('author'); after the content variable. I will need to change new_todo($content); and convert that data into an array like this alternative solution -> $content = $this->input->post('content'); $author = $this->input->post('author'); $stuff = new array($content, $author) $this->todo_model->new_todo($stuff); I am now not sure on how I will be able to use or retrieve this data in new_todo() function? I am just short of logical thinking and I am new to Php and MVC.
  8. I am not able to login into my site in IE8 its just redirecting back to the login page even though I have entered the correct details and I have set a session. It works Ok in Firefox. I have put a redirect in php on the script to redirect the user back to the login page if there is an error but its seems like in IE its just redirecting irregardless of the session is set or not.
  9. I have removed the session_register(), I had tried that before but that didnt solve the problem the only thing I didnt do was try the site in any other browser now that I have tried it in firefox and flock its working but it is still not working on IE8. I have tried turning errors on but still thats not showing any errors. I have also tried to check for errors in firefox but there is nothing showing.
  10. I have tried everything I can to set the session but I just cant seem to be getting anywhere so what can you suggest I put here if (($username != $admin) || ($password != $adminpass)) { $error_msg = ': <font color="#FF0000">Your login information is incorrect</font>'; } else { session_register('admin'); $_SESSION['admin'] = $username; require_once "index.php"; exit(); because I have tried everything. I have added the session_start() at the top of the script. I have also tried to remove the session_register('admin'); My version of php that is giving problems is PHP Version 5.2.9-1.
  11. I had already checked the register globals on both server and also the session handlers using phpinfo() and they both seem the same. The only difference I have on the servers is the version of php. The method I had tried for session_name will always result to a true value as mentioned so I will try the isset. I am at work now so will only try in 8 hrs. Please note that I have already used the phpinfo and know that the register globals are turned off on both servers.
  12. Thanks for the help. I have changed the top section of the create_page.php from if(!session_is_registered('admin')) to if(!session_name('admin')) and that has solved my problem. I am not using an Xamp or a AMP package on localhost but I am not sure about the host server. I guess I need to study more on sessions.
  13. I have checked both php.ini files and in both of them the register_globals turned off.
  14. I have tried changing the session_register() to session_start() but I am still being redirected back to my admin check. I think the problem might be elsewhere not the files I have posted because I proceed to the next page where the create_php is which I should not be able to access if the admin check is not correct. The $_SESSION['key'] = 'value' is it not the same as I have done here session_register('admin'); $_SESSION['admin'] = $username;. Also how come session_register is working on PHP Version 5.2.5 but not on PHP Version 5.2.11, because the PHP Version 5.2.5 is whats working on my laptop and the other on the host server.
  15. I have a login that has been working well on my test machine but now I have uploaded my site onto bluehost but its not working. Here is a copy of the php files <?php /* Created by Adam Khoury @ www.developphp.com */ $error_msg = ""; if ($_POST['username']) { $username = $_POST['username']; $password = $_POST['password']; // Simple hard coded values for the correct username and password $admin = "myname"; $adminpass = "mypassword"; // connect to mysql here if you store admin username and password in your database // This would be the prefered method of storing the values instead of hard coding them here into the script if (($username != $admin) || ($password != $adminpass)) { $error_msg = ': <font color="#FF0000">Your login information is incorrect</font>'; } else { session_register('admin'); $_SESSION['admin'] = $username; require_once "index.php"; exit(); } }// close if post username ?> <?php include('../includes/header.php');?> <?php if ($_SESSION['admin'] != "myname") { echo '<h3>Only the administrator can view this directory</h3><br /> <table width="340" border="0"> <form action="admin_check.php" method="post" target="_self"> <tr> <td colspan="2">Please Log In Here' . $error_msg . '</td> </tr> <tr> <td width="96">Username:</td> <td width="234"><input type="text" name="username" id="username" style="width:98%" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" id="password" style="width:98%" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="button" id="button" value="Log In Now" /></td> </tr> </form> </table> <br /> <br /> <br /> <a href="../index.php">Or click here to head back to the homepage</a>'; exit(); } ?> <?php include('../includes/footer.php'); ?> here is the create_page.php for creating the a new webpage when I try to access it it just refers me back to the the admin_check.php <? // You may copy this PHP section to the top of file which needs to access after login. session_start(); // Use session variable on this page. This function must put on the top of page. if(!session_is_registered("admin")){ // if session variable "username" does not exist. header("location:index.php"); // Re-direct to index.php } ?> <?php include('../includes/header.php');?> <script type="text/javascript" src="formfieldlimiter.js"> /*********************************************** * Form field Limiter v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Project Page at http://www.dynamicdrive.com for full source code ***********************************************/ </script> <script type="text/javascript"> function validate_form ( ) { valid = true; if ( document.form.heading.value == "" ) { alert ( "Please enter the heading." ); valid = false; } else if ( document.form.description.value == "" ) { alert ( "Please enter description for the story." ); valid = false; } else if ( document.form.pagebody.value == "" ) { alert ( "Please enter some info into the page body." ); valid = false; } return valid; } </script> <script language="JavaScript" type="text/javascript" src="scripts/wysiwyg.js"></script> <script language="JavaScript" type="text/javascript" src="scripts/wysiwyg-settings.js"></script> <script language="javascript1.2"> // attach the editor to all textareas of your page. //WYSIWYG.attach('all'); // attach the editor to the textarea with the identifier 'textarea1'. WYSIWYG.attach('pagebody'); </script> <table width="100%" border="0" cellpadding="8"> <form id="form" name="form" method="post" action="page_new_parse.php" onsubmit="return validate_form ( );"> <tr> <td><h3>Creating a New Page • <a href="index.php">Admin Home</a> • <a href="../" target="_blank">View Live Website</a></h3></td> </tr> <tr> <td>Be sure to fill in all fields, they are all required.<br /></td> </tr> <tr> <td> <fieldset> <table width="100%" border="0" cellpadding="5"> <form id="form" name="form" method="post" action="page_new_parse.php" onsubmit="return validate_form ( );"> <tr> <td align="right">Heading:</td> <td><input type="text" id="heading" name="heading" /></td> </tr> <tr> <td align="right">Short Description :</td> <td><textarea type="text" name="description" style="width:300px" id="description" rows="8"></textarea> <div id="description-status"></div></td> </tr> <tr> <td align="right">Category:</td> <td><select id="category" name="category"> <option>News</option> <option>Politics</option> <option>Entertainment</option> <option>Sports</option> <option>Health</option> <option>Religion</option> </select> </td> </tr> <tr> <td align="right">Country:</td> <td><select id="country" name="country"><option>Zimbabwe</option> <option>Kenya</option> <option>Ghana</option> <option>Nigeria</option> <option>Zambia</option> <option>Gambia</option> <option>South Africa</option> </select> </td> </tr> <tr> <td align="right">News :</td> <td><textarea id="pagebody" name="pagebody" rows="20" style="width:500px" ></textarea></td> </tr> <tr> <td align="right">keywords:</td> <td><input type="text" id="keywords" name="keywords" /></td> </tr> <tr><td colspan="2"><center><input type="submit" value="Add News"/></center></td></tr> </form> </table> </fieldset> </td> </tr> </form> </table> <!-- <form name="sampleform""> <input type="text" name="george" style="width:250px" /> <div id="george-status"></div> </form> --> <script type="text/javascript"> fieldlimiter.setup({ thefield: document.form.description, //reference to form field maxlength: 160, statusids: ["description-status"], //id(s) of divs to output characters limit in the form [id1, id2, etc]. If non, set to empty array []. onkeypress:function(maxlength, curlength){ //onkeypress event handler //define custom event actions here if desired } }) </script> <?php include('../includes/footer.php');?>
×
×
  • 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.