Jump to content

MrXortex

Members
  • Posts

    23
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

MrXortex's Achievements

Member

Member (2/5)

0

Reputation

  1. I got a movie search website but when I search something it says 404 page not found. The site is working under a framework called code igniter. Here is the back-end code of search engine: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Search extends CI_Controller { function __construct() { parent::__construct(); } public function index($extra=array()) { $q = $this->input->get('q'); if (!empty($q)) { redirect('search/' . $q); } redirect(); } public function do_search() { $this->load->model('movies'); $this->load->model('ssearch'); $search_string = $this->uri->segment(2); $data['main_menubar']['categories'] = $this->movies->get_all_categories(); $data['search']['results'] = $this->ssearch->search_for_movies($search_string); echo $this->load->view('includes/header', (isset($data['header']) ? $data['header'] : ''), true); echo $this->load->view('includes/main_menubar', (isset($data['main_menubar']) ? $data['main_menubar'] : ''), true); echo $this->load->view('search', (isset($data['search']) ? $data['search'] : ''), true); echo $this->load->view('includes/footer', (isset($data['footer']) ? $data['footer'] : ''), true); } } And the front-end code: <div class="content_segment recentMovies clearfix"> <div class="segment_title clearfix"> Search: <?php echo urldecode($this->uri->segment(2)); ?> </div> <!-- segment_title --> <div class="inner_padding clearfix"> <div class="horisontal_movie_list clearfix"> <?php if(empty($results)) : ?> <p>No movies found.</p> <?php endif; ?> <ul> <?php if(!empty($results)): ?> <?php foreach($results as $movie) : ?> <?php $categories = explode(',', $movie['categories']); $cat_ids = explode(',', $movie['categories_id']); $movie['categories'] = ""; for ($i=0; $i < count($categories); ++$i) { $movie['categories'] .= '<a href="'.site_url('view/category/'. $cat_ids[$i]).'">'.$categories[$i].'</a>, '; } $movie['categories'] = substr($movie['categories'], 0, -2); ?> <li> <a href="<?php echo site_url('view/movie/'. $movie['id']); ?>"> <div class="imageWrapper"> <img src="<?php echo base_url() . 'img/movie_covers/' . $movie['cover_image']; ?>" alt="No cover!" /> </div> </a> <div class="information"> <h4 class="title"> <?php if($movie['favorite'] == 1) : ?><img src="<?php echo base_url(); ?>img/other/favorite_icon_small.png" alt="" /><?php endif; ?> <a href="<?php echo site_url('view/movie/'. $movie['id']); ?>"> <?php echo $movie['movie_title']; ?> </a> </h4> <p class="meta"><?php echo $movie['categories']; ?> | <?php echo $movie['release_date']; ?> | First watched <?php echo date('F j, Y', $movie['watch_date']); ?></p> <p class="description"><?php echo $movie['description']; ?></p> </div> </li> <?php endforeach; ?> <?php endif; ?> </ul> </div> </div> <!-- list --> </div> <!-- content_segment --> The menu bar search: <menu class="menubar clearfix"> <a class="logo" href="<?php echo site_url(); ?>"></a> <ul class="clearfix"> <li> <a href="<?php echo site_url() ?>"> Home </a> </li> <li> <a href="<?php echo site_url('view/movies'); ?>"> Movies </a> </li> <li class="categories_link"> <a href="<?php echo site_url('view/category') ?>"> Categories </a> <ul> <?php foreach ($categories as $cat) : ?> <li><a href="<?php echo site_url('view/category/' . $cat['id']); ?>"><?php echo $cat['name']; ?></a></li> <?php endforeach; ?> </ul> </li> <li> <a href="<?php echo site_url('admin') ?>"> Admin area </a> </li> </ul> <div class="search"> <form action="<?php echo site_url('search'); ?>" method="GET"> <input type="search" name="search.php" value="" autofocus placeholder="Search" /> </form> </div> </menu> I hope someone finds a solution, I am stuck for 2 days. Cheers.
  2. Hello. This is a particle system made using Javascript (CoffeeScript) http://cssdeck.com/labs/53gonama3x How do I add more colors to the particles? Like Rainbow colors or RGB? Thanks.
  3. Hello. I created a little recover page. Users write the email and a random password is sent to them. The random password is successfully send in their emails but when they login with the new password it doesn't login. I think the new password does not updates in my database. How do I fix this issue? Heres the code: (avandare or avandaramn means 'users' in swedish if(isset($_POST['submit']) && $inLoggad == false){ //storing the posted info in variables $email = mysql_real_escape_string($_POST['email']); $exist = mysql_fetch_array( mysql_query("SELECT * FROM anvandare WHERE email='$email' LIMIT 1") ); if($exist['email'] == $email){ //creating a new generated password for the user, if the user has forgotten $newPwd = genPassword(); $newHashPwd = md5($newPwd); //send the new generated password via email of the user $message = "Hello " . $exist['anvandarnamn'] . ". Your new password is: " . $newPwd; $mailheader = "From: HighPload"; $mailheader .= "Reply-To: noreply@noreply.com"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; mail($exist['email'], "HighPload - Your new password has arrived!", $message, $mailheader) or die($fail = true); //Updating the new password in the dB if($fail != true){ mysql_query("UPDATE anvandare SET password='$newHashPwd' WHERE email='$email' "); } }else { $showErrors = true; } } elseif($inLoggad == true) { print '<script>window.location = "index.php"</script>'; } ?> Thanks
  4. Hello. I have a little complex code for a navigation menu. I want to add a dropdown to a <li> tag but it doesn't work. Heres the code <div id="topbar" class="fadeInOnLoad"> <div class="inner-topbar"> <ul> <?php if(currentPageName() == 'index.php'){ echo '<li class="">Home</li>'; }else { echo '<li><a href="index.php">Home</a></li>'; } if(currentPageName() == '../about.php'){ echo '<li class="">About</li>'; }else { echo '<li><a href="../about.php">About</a></li>'; } if(currentPageName() == 'terms.php'){ echo '<li class="">Terms</li>'; }else { echo '<li><a href="terms.php">Terms</a></li>'; } if(currentPageName() == 'contact.php'){ echo '<li class="">Contact</li>'; }else { echo '<li><a href="contact.php">Contact</a></li>'; } if(currentPageName() == 'browse.php'){ echo '<li class="">Browse Files</li>'; }else echo '<li><a href="browse.php">Browse Files</a></li>'; if($inLoggad == true){ //if user is logged in if(currentPageName() == 'upload.php'){ echo '<li class="">Upload Files</li>'; }else { echo '<li class="uploader"><a href="upload.php">Upload Files</a></li>'; } //right side of nav-bar //if user is logged in echo '<li class="highlight floatRight highlight"><a href="login.php?action=logout&ref=index.php">Logout</a></li>'; if(currentPageName() == 'account.php'){ echo '<li class="current floatRight highlight">' . $userinfo['anvandarnamn'] . '</li>'; }else { echo '<li class="floatRight highlight"><a href="account.php">' . $userinfo['anvandarnamn'] .'</a></li>'; } }else { //if user is not logged in if(currentPageName() == 'register.php'){ echo '<li class="current floatRight highlight">Register</li>'; }else { echo '<li class="floatRight highlight"><a href="register.php?&ref=index.php">Register</a></li>'; } if(currentPageName() == 'login.php'){ echo '<li class="current floatRight highlight">Login</li>'; }else { echo '<li class="loginToggle floatRight highlight"><a href="#">Login</a></li>'; } } ?> </ul> </div> <!-- inner-topbar --> </div> <!-- topbar --> So I want the account.php (My Account) to have the drop down. Inside it should have Logout.php and upload.php. But I don't know where to put it. I never experimented with these types of codes. They always mess up. Thanks.
  5. G'day, I created my own simple blog with some posts in it, the posts are stored in a folder called "posts" and there in .MD format. I want to put a search engine on my blog when they search anything that looks similar to any blog.. it should show the results.. I can create a MySQL dB but I don't what do I add in the fields? And how do I link them? If you still don't get me, let me know. I'll explain briefly. Thank you.
  6. Now its going okay but its still cut off and all the way to the left. http://i.imgur.com/CXavC.png
  7. G'day trying to fix this issue for over 2 weeks now. I have made a footer but can't get it right to the bottom.. The problem is I have a slider that slides down to get some information. I want the footer to slide down with it too, I want the footer to be at the bottom, it should resize by itself, like if a person has a 22" monitor it should stay at the bottom and if the person has a 15" monitor is should do the same. But I don't want the position:fixed; some of the text gets hidden behind the footer. Just want it at the bottom.. like it should be able to scroll down too when slider is activated. The image will explain everything I guess. http://i.imgur.com/ASt7G.png Code: The HTML: HTML: <div class="footer_gray"> <div class="inner_footer"> <div class="footer_right"> <p>For feedback or support: admin </div> <div class="footer_left"> <p>Copyright © 2012<p> </div> </div> </div> The CSS: .footer_gray{ padding: 10px; background: #CCC; text-align: center; line-height: 35px; color: #D4D4D4; font-size: 13px; text-align: center; text-shadow: white 0 1px 0; overflow: hidden; margin-top: 80px; position: relative; background-color: #F5F5F5; background-image: -webkit-gradient(linear, left top, left bottom, from(#F5F5F5), to(#FAFAFA)); background-image: -webkit-linear-gradient(top, #F5F5F5, #FAFAFA); background-image: -moz-linear-gradient(top, #F5F5F5, #FAFAFA); background-image: -o-linear-gradient(top, #F5F5F5, #FAFAFA); background-image: linear-gradient(to bottom, #F5F5F5, #FAFAFA); border-top: 1px soli Your help will be highly appreciated! Thank you.
  8. Hello. I am trying to create a registeration system on my website using PHP and MySQL. BUt whenever I put <?php ?> tags and start coding and test it, I get this error Parse error: syntax error, unexpected T_STRING on line 39 Here is my code: <?php $form = "<form method="post" action="signup-p.php" id="signupform"> <div class="form"> <div class="fieldset"> <input name="signup_form" type="hidden" /> <div class="input"> <label for="username">Username</label> <input type="text" name="user" id="username" value="" /> </div> <div class="input"> <label for="email">E-mail</label> <input type="text" name="email" id="email" value="" /> </div> <div class="input"> <label for="email_confirm">Confirm E-mail</label> <input type="text" name="email_confirm" id="email_confirm" value="" /> </div> <div class="input"> <label for="password">Password</label> <input type="password" name="password" id="password" /> </div> <div class="input"> <label for="password_confirm">Confirm password</label> <input type="password" name="password_confirm" id="password_confirm" /> </div> </div> <div class="button"><strong><input type="submit" class="submit" name="registerbtn" value="Sign up" /></strong></div> </div> </form>" ?> The code error on line 39: $form = "<form method="post" action="signup-p.php" id="signupform"> If you need more details, let me know. Please help me fix the issue. Thanks. Hassan.
  9. I didn't get you sorry. Can you show me an example?
  10. Hello I made a file uploading system and whenever a user uploads a file and adds a description. It doesn't comes out the way it is. Example: What I wrote: This is a test that if going to the next line works or not New line 2nd line Added a space above. TEST How it shows up: This is a test that if going to the next line works or not\r\n\r\nNew line\r\n\r\n2nd line\r\n\r\nAdded a space above.\r\n\r\n- TEST Anyone knows what I mess up? Here's the code: <?php include('header.php'); if(isset($_GET['id'])){ $id = mysql_real_escape_string($_GET['id']); $sql = mysql_fetch_array(mysql_query("SELECT * FROM filer WHERE id='$id' LIMIT 1")); $fileInfo = @array_map('mysql_real_escape_string', $sql); if(empty($fileInfo)){ echo ' <script> window.location = "index.php"; </script> '; } } if($inLoggad == true && $userinfo['id'] == $fileInfo['uploader'] && isset($_GET['delete']) && is_numeric($_GET['delete'])){ $delId = $_GET['delete']; mysql_query("DELETE FROM filer WHERE id='$delId'"); mysql_query("DELETE FROM kommentarer WHERE fileID='$delId'"); mysql_query("DELETE FROM rated_files WHERE fil_id='$delId'"); unlink("file/" . $fileInfo['folder_name'] . "/" . $fileInfo['file_name']); rmdir("file/" . $fileInfo['folder_name']); echo '<script>window.location = "index.php"</script>'; } if($inLoggad == true && $userinfo['id'] == $fileInfo['uploader'] && isset($_POST['editDesc'])){ $description = mysql_real_escape_string($_POST['info']); mysql_query("UPDATE filer SET filinfo='$description' WHERE id='" . $fileInfo['id'] . "'"); echo '<script type="text/javascript"> window.location = "view.php?id=' . $_GET['id'] . '" </script>'; } if(isset($_POST['submitComment']) && $inLoggad == true){ $comment = mysql_real_escape_string($_POST['text']); $postedBy = $userinfo['id']; mysql_query("INSERT INTO kommentarer (fileId, text, postedBy, date, exakt_date) VALUES('" . $fileInfo['id'] . "', '$comment', '" . $postedBy . "', '$date', '$exact_date')"); } $hasVoted = mysql_fetch_array( mysql_query("SELECT * FROM rated_files WHERE fil_id='" . $fileInfo['id'] . "' AND anv_id='" . $userinfo['id'] . "'") ); if(isset($_GET['rate']) && is_numeric($_GET['rate']) && isset($_GET['id']) && is_numeric($fileInfo['id']) && $inLoggad == true && empty($hasVoted['fil_id'])){ $rate = $_GET['rate']; $currRatings = mysql_fetch_array( mysql_query("SELECT rank FROM filer WHERE id='" . $fileInfo['id'] . "' LIMIT 1") ); $currRateUp = mysql_fetch_array( mysql_query("SELECT rank_up FROM filer WHERE id='" . $fileInfo['id'] . "' LIMIT 1") ); $currRateDown = mysql_fetch_array( mysql_query("SELECT rank_down FROM filer WHERE id='" . $fileInfo['id'] . "' LIMIT 1") ); if($rate > 0){ $newRatingsUp = $currRateUp['rank_up'] + 1; $newRatings = $currRatings['rank'] + 1; //lنgg till vote mysql_query("UPDATE filer SET rank='$newRatings' WHERE id='" . $fileInfo['id'] . "'"); //lنgg till vote mysql_query("UPDATE filer SET rank_up='$newRatingsUp' WHERE id='" . $fileInfo['id'] . "'"); }else { $newRatingsDown = $currRateDown['rank_down'] + 1; $newRatings = $currRatings['rank'] - 1; //lنgg till vote mysql_query("UPDATE filer SET rank='$newRatings' WHERE id='" . $fileInfo['id'] . "'"); //lنgg till vote mysql_query("UPDATE filer SET rank_down='$newRatingsDown' WHERE id='" . $fileInfo['id'] . "'"); } //lنgg till att anvنndaren har rِstat fِr att undvika att han rِstar igen mysql_query("INSERT INTO rated_files (fil_id, anv_id) VALUES('" . $fileInfo['id'] . "', '" . $userinfo['id'] . "')"); echo '<script type="text/javascript"> window.location = "view.php?id=' . $fileInfo['id'] . '" </script>'; } if(isset($_GET['rate'])){ echo '<script type="text/javascript"> window.location = "view.php?id=' . $fileInfo['id'] . '" </script>'; } ?> <link href="css/view.css" rel="stylesheet" media="screen" /> <link href="css/topbar.css" rel="stylesheet" media="screen" /> <link href="css/loginOverlay.css" rel="stylesheet" media="screen" /> <title>HighPload - <?php echo $fileInfo['real_name']; ?></title> </head> <body> <?php include('includes/topbar.php'); $u = mysql_fetch_array(mysql_query("SELECT * FROM anvandare WHERE id='" . $fileInfo['uploader'] . "' LIMIT 1")); ?> <div id="content"> <div id="view_header"> <a href="index.php"> <img class="logo" src="images/small_logo.png" alt="Go home" /> </a> </div> <!-- top_header --> <span class="border"></span> <div id="info"> <h2 title="Download <?php echo $fileInfo['file_name']; ?>"><img src="images/icons/category-icons/<?php echo $fileInfo['ikon']; ?>.png" alt="<?php echo $fileInfo['ext']; ?>" title="Category: <?php echo $fileInfo['ikon']; ?> (<?php echo $fileInfo['ext']; ?>)" /> <a target="_blank" href="get.php?id=<?php echo $fileInfo['id']; ?>"><?php echo $fileInfo['real_name']; ?></a> (<?php echo $fileInfo['file_name']; ?>)</h2> <span><?php echo $fileInfo['storlek']; ?>MB <font style="color: #B4B4B4;">|</font> <?php echo $fileInfo['nerladdningar']; ?> downloads - Uploaded by <?php echo "<a href='view_account.php?id=" . $fileInfo['uploader'] . "'>" . $u['anvandarnamn'];?></a></span> <span><?php echo $fileInfo['rank_up']; ?> people like this, <?php echo $fileInfo['rank_down']; ?> dislikes this.</span> <span style="color: red";>Click the tittle of the file to Download!</p></span> <?php if($inLoggad == true) { if(!empty($hasVoted['fil_id'])) {echo "&nbsp";}else {?> <span class='ratings'><a href='view.php?id=<?php echo $_GET['id']; ?>&rate=1'><img src='images/icons/small_plus.png' alt='' /> Like</a> <a href='view.php?id=<?php echo $_GET['id']; ?>&rate=0'>Dislike</a></span> </span> <?php } }else { echo ""; } if($userinfo['id'] == $fileInfo['uploader']){ ?> <p class="optionLine"><a href="#" class="toggle_editDescription">Edit Description</a> | <a href="#" class="toggle_deleteFile">Delete this file</a><a title="You can't regret this!" style="display: none;" href="view.php?id=<?php echo $fileInfo['id']; ?>&delete=<?php echo $fileInfo['id']; ?>" class="deleteFile">Are you sure?</a></p> <?php } ?> <p class="description"><?php echo str_replace("\n","\n<br />", $fileInfo['filinfo']); ?></p> <div class="edit_description" style="display: none;"> <form action="view.php?id=<?php echo $fileInfo['id']; ?>" method="post"> <textarea name="info"><?php echo $fileInfo['filinfo']; ?></textarea> <input type="submit" name="editDesc" class="editDescBtn" value="" /> </form> </div> </div> <!-- information --> </div> <!-- content --> <div id="commentArea"> <?php $sql = mysql_query("SELECT * FROM kommentarer WHERE fileId='" . $fileInfo['id'] . "' ORDER BY exakt_date ASC");?> <h2>Comments <span>(<?php echo mysql_num_rows($sql); ?>)</span></h2> <ul> <?php while($unique_comment = mysql_fetch_array($sql)){ $unique_comment = array_map('htmlspecialchars', $unique_comment); //get the ID of the user $cid = mysql_fetch_array( mysql_query("SELECT * FROM anvandare WHERE id='" . $unique_comment['postedBy'] . "'") ); $cid = array_map('htmlspecialchars', $cid); //odd or even ?> <li<?php if($i%2){ echo ' class="odd"';} ?>> <p class="title"><a href="view_account.php?id=<?php echo $cid['id']; ?>"><?php echo $cid['anvandarnamn']; ?></a><small> - <?php echo $unique_comment['date'];?></small></p> <p><?php echo str_replace("\n","\n<br />", $unique_comment['text']); ?></p> </li> <?php $i++; } ?> </ul> <?php if($inLoggad){ ?> <div id="newComment"> <form method="POST" action="view.php?id=<?php echo $fileInfo['id']; ?>"> <textarea type="text" name="text" onclick="if(this.value=='Add a Comment...')this.value=''" onblur="if(this.value=='')this.value='Add a Comment...'">Add a Comment...</textarea> <input class="submitBtn" type="submit" name="submitComment" value="" /> </form> </div> <!-- newComment --> <?php }else { ?> <div id="loginToComment"> <p>Please <a href="#" class="loginToggle">login</a> or <a href="register.php" class="logonToggle">register</a> to leave a comment.</p> </div> <?php } ?> </div> <!--commentArea --> <?php include('includes/loginOverlay.php');?> <script src="js/jquery-1.4.2.min.js"></script> <?php include('js/fadein.php'); ?> <script> <?php include('js/loginOverlay.js'); ?> $(document).ready(function() { $('.toggle_editDescription').click(function() { if ($('.description').is(":visible")) { $(".description").slideUp(500,function(){ $('.edit_description').slideDown(1000); }); } else { $(".edit_description").slideUp(1000,function(){ $('.description').slideDown(500); }); } }); $('.toggle_deleteFile').click(function() { $('.toggle_deleteFile').fadeOut(500, function() { $('.deleteFile').fadeIn(500); }); }); }); </script> <span style="display: block; clear: both;"></span> <?php include('footer.php'); ?> </body> </html> And thats it! I hope you guys can find the solution. Thanks.
×
×
  • 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.