Jump to content

dannyb785

Members
  • Posts

    544
  • Joined

  • Last visited

Everything posted by dannyb785

  1. ^^ did you even read his question? He said that he uses stripslashesand it messes things up. I dont know how the text is when you're inserting it in the database, but it needs to be like this... don't do anything do it(except addslashes) when inserting. Don't give it entities or anything. When displaying the data, do stuff to it just before outputting it. Like for example: while($row = mysql_fetch_assoc($result)) { extract($row); $text = htmlentities($page_data); echo $text; } And if you're putting the data into a textarea or input field, you don't need to do anything to it while($row = mysql_fetch_assoc($result)) { extract($row); echo "<textarea rows=5 cols=5 name=whatever>$text</textarea>"; } I never use stripslashes.. ever. If you need to use them, then you've been adding slashes when you don't need to. I think you may have magic_quotes on. When that's on, it adds slashes automatically. And then if you try to remove slashes, it will find "\n" and make it "n"
  2. only during production. And get rid of them once everything is working correctly
  3. I'm pretty sure you'd need to change your .htaccess file to convert something like domain.com/1234 to domain.com/view.php?code=1234 kinda like myspace. I don't think it's something you can do just entirely in html without anything else. Once the .htaccess file is modified, you can do what was said where you'd have a form with a GET method
  4. change $sql = "select * from wvideos where '".$_POST['surl']."' LIKE vmkey"; to $surl = addslashes($_POST['surl']); $sql = "select * from wvideos where vmkey LIKE '%$surl%' "; That should do it(provided the column name with the vmkeys's name is 'vmkey'. ).
  5. I don't use xml all that much, but I'd say when you have the color variable ready(with all the colors separated by , do a $temp = explode(";", $colors) and then step through each variable, printing a <color> tag for each. Remember to ignore the last one though, since it will be blank(since there's nothing on the right side of your last semicolon)
  6. Good design guidelines is make your entire page's width set at 800(maybe 850 if you have to). Because there are still lots of people who have older computers and can't view pages with 1000px wide setups without side scrolling(in web design, side scrolling == bad). Even those with 1024x768 can view it easily and if people have those crazy big resolutions(1600 or higher) they are likely already used to most sites looking small. But making 2 pages for each resolution(even if you can do it) isn't a good idea. But if you absolutely have to, I'd say have a splash page(a HUGE web design no no) that says "What resolution are you?" and they click accordingly. And then have a "I dont know" link and go to the 800x600 layout since if someone doesnt know their resolution, they probably have an older computer(just my guess).
  7. ^ did you even read my post? Put the style properties in the td. Is that not answering your question?
  8. Take that off and use google's adsense banner that says "Best viewed in Forefox" so they can click it, download it, and if they make it their default browser, you get like $2 or so. That's the better approach.
  9. Yea, get rid of position:absolute; and to space the divs apart, use "margin-bottom:10px" or however many px you want them apart. Oh and I dont think width: auto does anything. But I could be wrong.
  10. Did you write this code? I'm not going to mess with it since it's all displayed entirely in javascript. I don't mind js, but using it to display all the html = not a good idea. I'd probably be able to help if it were typed in html separately.
  11. nope. Now bear in mind that if you're using different functions in php to compare email addresses, the case may metter(depending which you use). but if you're just using the mail() function, case doesnt matter
  12. lol dude. this is a site for free php/html/mysql help. If you want someone to go through all that code and diagnose the problem, you're gonna have to pay someone. Unless someone has alotta free time
  13. I'm pretty sure you can't modify a table row. You have to modify the individual td's. The code provided(style="border:1px solid black") will work as desired in the td.
  14. borders being off have nothing to do with php. Unless your php is coded wrong in the area that displays the border
  15. I have no idea where you got your code from. When I do zebra stripes, it's unrelated to the query's array. I do... $n = 0; while($row = mysql_fetch_assoc($result)) { extract($row); if($n%2 == 0) $bgcolor="whatever color"; else $bgcolor="other color"; echo "<td bgcolor=$bgcolor>text</td>"; } and modify as needed. This is provided you only need alternating colors. If you're looking for different colors based on the content, let us know.
  16. If you can't edit the script and tell us if the help worked, why even ask?
  17. I dont think you can do 2 separate queries at the same time. Just split them up into 2. And I dont think <> is a valid checker. do '!=' (not equal to) also, add single quotes around the variables(like "where id='$id', not "where id=$id") and also, on your die statement after a query, make it "or die(mysql_error());" that'll help you with what the problem is. And I'm confused with "UPDATE ".$db_prefix."sportsdb_conferences" what is db_prefix? I dont see it declared as anything. I don't think you need multiple different tables for this kind of thing.
  18. The problem with telling him to just use htmlentities is that he probably doesn't know why it works. Takamine, html tags display as they are supposed to when "<anything>" is types. Anytime html sees a "<" it won't print anything out until after a closing ">" is printed, and then it makes whatever changes are needed til is sees a closing "</whatever>" tag. So for you to print a < without it thinking it's an html tag, you'll need to type out the assosicated 'entity' code for it. For example, ya know how if you type 5 space between words, it doesnt care and only adds one space? Well, the space entity code is ' ' so if you want 5 spaces, you need to type 5 's or else it won't print them. Now, the easy way to add entities is as suggested, with the htmlentities function. But if you dont' want to have to to that all the time, you can do the entity code for the < and > which is < and >, respectively. An easy way to remember is all entities starts with a & and end with a ;. And with these 2, you have a 'greater than' sign and a 'less than' sign. Hence, < and > There is an entity for (I think ) every character that needs to be displayed literally on the page. Hope that made sense. Hope that made sense.
  19. Are you trying to do zebra stripes for a table? Or can you just give us an idea of what you're trying to do?
  20. Ok I have bolded the errors or things you need to fix <?php include("configuration.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } $result = mysql_query("SELECT * FROM Assignment"); $num_rows = mysql_num_rows($result); $i = 0; echo"<table width="100%" border="0">"; echo"<tr> <td>[b]$nbsp;[/b]</td> <td>Assignment ID</td> <td>Title</td> <td>School ID</td> <td>Description</td> </tr>"; while([b]$row = mysql_fetch_array($result)[/b]) { $query = "Select * from Assignment where AssnID = [b]'$i'[/b]"; // you need single quotes around the variable $result = mysql_query($query); ; echo" <tr> [b]<td>$row['column_name']</td> <td>$row['column_name']</td> <td>$row['column_name']</td> <td>$row['column_name']</td> <td>$row['column_name']</td>[/b] </tr> "; [b]$i++[/b] } echo"</table>"; ?> EDIT: well, apparently it won't bold if the text is in code tags. Oh well, look for the [ b] tags
  21. lol wtf I have no idea what I was thinking when I posted my reply
  22. you need to do the error function as: $result = mysql_query("QUERY") or die(mysql_error()); that should show the error also, when you get the blank page, view the source and see if anything is printing. Like the </table> tag that you have set to output whether $r is true or not. If it does display, then there's an error grabbing the data. If it's blank, then you have error in the code.
  23. are your column names numbers? If so(which is a horrible idea and might not even work correctly), you need to make your while statement into: while($row = mysql_fetch_array($result)) { stuff with $row[1] and so on } but if your column names are things like id, name, email, etc then you'd have to do $row[id], $row[name], etc
×
×
  • 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.