Jump to content

contra10

Members
  • Posts

    402
  • Joined

  • Last visited

    Never

Everything posted by contra10

  1. sounds good but how about the height percentage
  2. I was chaning all my pixel values into percentage values to get myself a liquid layout but it seems as if my header won't change based on th percentage. when I input a pixel amount it the header shows up but when i put in a percentage amount nothing shows #header { height:100%; line-height:46%; background: #FE7B09 url(includes/bg.jpg) repeat-x; } and this is the one that works #header { height: 100px; line-height: 60px; background: #FE7B09 url(includes/bg.jpg) repeat-x; }
  3. I have a website up and basically the resolution it doesn't adapt to different monitors. So on differen computers it changes how wide the website is . How can I make so that its the same for most if not all computers?
  4. wow i totally forgot about that, thanks
  5. I'm trying to create a url where there is wording before the root ie. http://blog.webhosting.uk.com/web-hosting/types-of-url-absolute-and-relative/ http://images.google.ca/ http://video.google.ca/ how do i do this
  6. I'm trying to create a search bar thats when a person enters a variable it redirects them to the results page, when a person searches the first time its of but then when on the results page and a person searches then the result is an iframe with the information inside of it, and no redirect in browser. my coding <?php $find = $_POST['input']; // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); if(isset($_POST['submit'])){ header("Location: http://www.test.com/add/search.php?pagenum=1&search=$find"); } ?> <form name="search" method="post" action="<?=$PHP_SELF?>"> Seach for: <input type="text" name="input" /> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="submit" value="Search" /> </form> and the results page TEST Results <iframe src="http://www.test.ca/add/searchfor.php" scrolling="no" frameborder="0"> </iframe> <table border="0" width="900" valign="top"> <tr><td><h3>SEARCH RESULTS</h3></td></tr> </table> <table border="0" width="900" valign="top" height="500"> <?php // Connects to your Database mysql_connect("localhost", "", "") or die(mysql_error()); mysql_select_db("deals") or die(mysql_error()); //This checks to see if there is a page number. If not, it will set it to page 1 $pagenum = $_GET['pagenum']; if ($pagenum) { } else{ $pagenum = 1; } $sr = $_GET['search']; if($sr){ //Here we count the number of results $querye = "SELECT * FROM `deal` WHERE `title` LIKE '%$sr%' and `release`='yes'"; $result = mysql_query($querye) or die(mysql_error()); $rows= mysql_num_rows($result); ?>
  7. when i click pg 2. the results that are on the first page stays displayed
  8. This is what echoes out $pagenum = 1 $last = 3 $es = 3
  9. I'm trying to do this pagination script but everytime i click on "page 2" or "last" i get the same data in page one, basically nothing happens except for the url that changes from something like this http://localhost/outdoor/next/ to http://localhost/outdoor/next/index.php?pagenum=2 <?php // Connects to your Database mysql_connect("localhost", "", "") or die(mysql_error()); mysql_select_db("deals") or die(mysql_error()); //This checks to see if there is a page number. If not, it will set it to page 1 if (!(isset($pagenum))) { $pagenum = 1; } //Here we count the number of results //Edit $data to be your query $querye = "SELECT * FROM `deal` WHERE `category` = 'Outdoor' and `time` = '704'"; $result = mysql_query($querye) or die(mysql_error()); $rows= mysql_num_rows($result); //This is the number of results displayed per page $page_rows = 2; $es = ($rows/$page_rows); //This tells us the page number of our last page $last = ceil($es); //this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //This sets the range to display in our query $max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows; //This is your query again, the same one... the only difference is we add $max into it $data_p = mysql_query("SELECT * FROM `deal` WHERE category = 'Outdoor' and time = '704' $max") or die(mysql_error()); //This is where you display your query results while ($postede = mysql_fetch_assoc($data_p)) { $title = "{$postede['title']}"; $imagename = "{$postede['imagename']}"; $time = "{$postede['time']}"; $titled = stripslashes($title); $url = "{$postede['url']}"; $on= "on"; $off= "off"; echo "<tr>"; echo"<td width='10%' height='200'><a href='$url' target='_blank'><img src='http://localhost/includes/704/$imagename.jpg'></a></td>"; echo "</tr>"; echo "<tr><td></td></tr>"; } echo"<p>"; // This shows the user what page they are on, and the total number of pages echo " --Page $pagenum of $last-- <p>"; // First we check if we are on page one. If we are then we don't need a link to the previous page or the first page so we do nothing. If we aren't then we generate links to the first page, and to the previous page. if ($pagenum == 1) { } else { echo " <a href='{$_SERVER['PHP_SELF']}?p=1'> <<-First</a> "; echo " "; $previous = $pagenum-1; echo " <a href='{$_SERVER['PHP_SELF']}?p=$previous'>$Previous</a> "; } //just a spacer echo " ---- "; //This does the same as above, only checking if we are on the last page, and then generating the Next and Last links if ($pagenum == $last) { } else { $next = $pagenum+1; echo " <a href='{$_SERVER['PHP_SELF']}?p=$next'>$next -></a> "; echo " "; echo " <a href='{$_SERVER['PHP_SELF']}?p=$last'>Last ->></a> "; } ?>
  10. i used mysql_fetch_assoc() before but i think i know what i did wrong thxs
  11. i can't seem to do a simple query and i don't know what I'm missing <?php $querye = "SELECT * FROM `deal` WHERE `category` = 'Outdoor' and `time` = '704'"; $result = mysql_query($querye) or die(mysql_error()); echo "$result"; ?>
  12. works, i tried the slashes before but i guess i put an extra one, thanks
  13. i copied it exactly <?php echo"<td td align='center' class='off' onmouseover='this.className='$on' onmouseout='this.className='$off'> ?> but the mouseover doesn't work, it simply stays the same colour - white.
  14. i tired that b4 but it didn't work, double quote issue
  15. I'm trying to mix css with php if possible using onmouseover I'm withdrawing data into a table and when ever a person goes over a specific area I'm trying to change the back ground heres my coding <style type="text/css"> td.off { background: white; } td.on { background: red; } </style> My php is as follows: <?php $on= "on"; $off= "off"; echo"<td align='center' class='off' onmouseover='this.className=" .$on. "' onmouseout='this.className=" .$off. "'> ?>
  16. Basically everytime I input data into mysql and I put a " or a ' the data comes out with a backslash i.e. i input this into my database Ram x 15'6" Canoe and it comes out as Ram x 15\'6\" Canoe
  17. I'm trying to have the page loaded and a random drop down item is selected any clue as to how i start doing this
  18. i still get the symbols not the actual image <?php $im = imagecreatefromjpeg("image.jpg"); $x = imagesx($im); $y = imagesy($im); $desired_width = 60; $desired_height = $y * ($desired_width/$x); $new = imagecreatetruecolor($desired_width, $desired_height); imagecopyresampled($new, $im, 0, 0, 0, 0, $desired_width, $desired_height, $x, $y); imagedestroy($im); echo "<div style='width: 100%; padding: 3px; border: 1px solid #000; background-color: green;'>" . imagejpeg($new, null, 85) . "</div>"; ?>
  19. im trying to create a thumbnal version of images that are in my directory but i can't seem to get it to work heres my coding <?php $im = imagecreatefromjpeg("http://localhost/toronto/image.jpg"); $x = imagesx($im); $y = imagesy($im); $desired_width = 60; $desired_height = $y * ($desired_width/$x); $new = imagecreatetruecolor($desired_width, $desired_height); imagecopyresampled($new, $im, 0, 0, 0, 0, $desired_width, $desired_height, $x, $y); imagedestroy($im); echo "<div style='width: 100%; padding: 3px; border: 1px solid #000; background-color: green;'>" . imagejpeg($new, null, 85) . "</div>"; ?>
  20. Hi im trying to build a crawler and right now im trying to get information from websites and save it in my db. right now im testing on my local host and was wondering if i can access live pages. I tried to copy a wikipedia website and i got this 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 'text/javascript'>if (wgNotice != '') document.writeln(wgNotice); i was wondering if im on the right track or loss... heres my coding <?php //This code runs if the form has been submitted if (isset($_POST['submit'])) { $search = mysql_real_escape_string($_POST['search']); $data = file_get_contents("$search"); // now we insert it into the database $insert = "INSERT INTO `web` (`website`, `index`) VALUES ('$search', '$data')"; $add_web = mysql_query($insert) or die (mysql_error()); echo "$data"; ?> sucess <?php }else{ ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <h2><a href="#">Add a site</a></h2><br> <input type="text" size="35" name="search"/><br> <input type="submit" name="submit" /> </form> btw it will work for pages in my local host
  21. i'm trying to get my dynamic web content to get indexed i read some up on it and the url which contains the "?" is repellant for index spiders. i figured that i should use for example this code <?php $original_url = "http://www.url.com/event.php?ev=$eventid"; $split_url = explode('?', $original_url); $no_querystring_url = $split_url[0]; // http://www.domain.com/file1.php echo "<td><a href='$no_querystring_url'>$eventname</a><br>"; ?> problem is how can i retireve the information in the actual page before i used <?php if(is_numeric($_GET['ev'])){ $id = $_GET['ev']; } ?> i'm open to any other suggestions on getting dynamic content indexed
  22. i'm afraid that eventually my number is going to be too high, plus i really am not a fan of long urls... but i was looking around and there's suppose to be an alter code...this is what im doing but doesn't really work ye i guess ill just deal with it
  23. so should my script be something like "ALTER table"...although i wouldn't know what top put... is there a way in php my admin
×
×
  • 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.