Jump to content

Rosst

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by Rosst

  1. Rosst

    HELP!

    Ok, I'm not going to use that, but instead I am working on something else, a video website, like youtube, and well it's not working again, here are my codes. index.php: [code=php:0]<html> <head> <title>VideoPlayer</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <div id="head">VideoPlayer</div> <br> <div id="main"> <?php include("main.php"); ?> </div> <div id="content"></div> </body> </html>[/code] main.php [code=php:0]<?php $conn = mysql_connect("localhost", "rosst", "*********************"); mysql_select_db("videos") or die(mysql_error()); if (@!$_GET['cat']) { $mysql = mysql_query("SELECT*FROM cats ORDER BY id DESC"); while ($m = mysql_fetch_array($mysql)) { echo "<a href=\"#\" onClick=\"ajaxFunction();\" id=\"cat\" value=\"".$m['id']."\">$m[name]</a><br />$m[desc]<hr />"; } } else { if (@!$_GET['video']) {%
  2. Ok what I want to do is submit a form which goes to a php file which generates a image which will then be displayed on the page with the form, I have tryed and it hasn't worked.
  3. I've deleted what I had so far because I thought that someone might have the codes to do it.
  4. Ok, there is this site, http://msig.info/web2.php and it makes site logos and when you make one (type in something in the field and press generate) there is a popup that shows you this stuff, and I want to know how to do that, I know it is in AJAX and PHP, I just need to know how to do it, thanks for the help!! This is the thread that I posted before I just didn't see this forum before, thanks for the help.
  5. Ok, there is this site, http://msig.info/web2.php and it makes site logos and when you make one (type in something in the field and press generate) there is a popup that shows you this stuff, and I want to know how to do that, I know it is in AJAX and PHP, I just need to know how to do it, thanks for the help!!
  6. Ok, well I am trying to make comments for my news system on my site.. And I am getting this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/avexxon/public_html/blah/includes/news.php on line 49, and on line 49 is this code: $commentsnum = mysql_num_rows(mysql_query("select * from newscomments where news = '$_GET[id]' order by id asc limit $from, $max_results"));, you can see here: http://www.vexxon.net/blah/?view=news&act=comments&id=1, thanks in advance for any help
  7. http://vexxon.net/index.php?id=vthread&t=5 (It was a test for the bbcode) Check that out, you see that you get a error: Warning: Unexpected character in input: '' (ASCII=92) state=1 in /home/avexxon/public_html/includes/ubb.php on line 137, and line 137 is: function parse_php($tree)  {return '<div class="wrap"><div class="title">PHP Code</div><div class="content">'.nl2br(highlight_string(unhtmlentities(''.$tree->toText().'')), true).'</div></div>';} Don't say anything about unhtmlentities() it's a functions I made.
  8. It is in descending order right now, and it doesn't look like it should, none of you are helping me!
  9. I use the same thing, it doesn't work, except I have asc instead on desc [code=php:0]<?php include("config.php"); $a = mysql_query("select * from snake order by score asc limit 5"); while ($b = mysql_fetch_array($a)) { echo "<a href=\"index.php?id=memb&user=".$b[uname]."\">".$b[uname]."</a> - ".$b[score]."<br />"; } if ($logged[username]) { echo "Play snake: <a href=\"snake/snake.swf\">Link</a>"; } ?>[/code]
  10. I want to select the highest scores from a database, it's from a PHP/MySQL/Flash snake game, see here: http://vexxon.net/index.php? the bottom right content thingy has the snake high scores, but it's not in order, how would I put them in order? Thanks in advance for the help.
  11. Hmm, I need help again, see right now I am looking at one of the tutorials I posted on my site and I see [code=php:0] in it, but it shouldn't be there, and there is a gap at the top, does anyone know how to fix it? Sometimes it doesn't even highlight it... http://vexxon.net/index.php?id=tuts&cat=12&tutid=1 there it is, you can see, I am using the same code I posted before
  12. Hello, I have a small problem with my bbcode, I got it fixed here at php freaks, and I thought it was OK the way it was, what happens is when I use bbcode there are massive spaces between lines, and I need that to be fixed, example of what it looks like: http://vexxon.net/index.php?id=tuts&cat=PHP&tutid=1 example of what I want it to look like: http://dannyscripts.com/?view=tutorials&act=tutorial&id=101 And my code: [code]<? function bbcode($content) {     $bbcode = array(       "'\[b\](.*?)\[/b\]'",       "'\[i\](.*?)\[/i\]'",       "'\[u\](.*?)\[/u\]'",       "'\[code\](.+?)\[/code\]'",       "'\[url=(.*?)\](.*?)\[/url\]'",       "'\[url\](.*?)\[/url\]'",       "'\[img\](.*?)\[/img\]'",       "'\[red\](.*?)\[/red\]'",       "':\)'",       "':p'",       "':o'",       "':huh\?:'",       "':C'",       "':D'",       "':lol:'",       "':shades:'",       "':blink:'",       "':blush:'",       "'!!'",       "':check:'",     );     $html = array(         "<b>\\1</b>",         "<i>\\1</i>",         "<u>\\1</u>",         "<strong>Code:</strong><div style=\"margin:0px 10px;padding:5px;border:1px dotted #000000;width:80%;\"></em>\\1</em></div>",         "<a href=\"\\1\" target=\"_BLANK\">\\2</a>",         "<a href=\"\\1\" target=\"_BLANK\">\\1</a>",         "<img border=\"0\" src=\"\\1\">",         "<font color=\"#FF6600\">\\1</font>",         "<img src=\"includes/smileys/smile.gif\">",         "<img src=\"includes/smileys/tongue.gif\">",         "<img src=\"includes/smileys/ohmy.gif\">",         "<img src=\"includes/smileys/huh.gif\">",         "<img src=\"includes/smileys/angry.gif\">",         "<img src=\"includes/smileys/biggrin.gif\">",         "<img src=\"includes/smileys/laugh.gif\">",         "<img src=\"includes/smileys/cool.gif\">",         "<img src=\"includes/smileys/blink.gif\">",         "<img src=\"includes/smileys/blush.gif\">",         "<img src=\"includes/smileys/!!.gif\">",         "<img src=\"includes/smileys/check.gif\">",     );     $content = preg_replace($bbcode, $html, $content);     // call a dedicated function to highlight our php code.     $content = preg_replace_callback("#\[php\](.*?)\[\/php\]#is", 'highlight_php', $content);     return stripslashes(nl2br($content)); } function highlight_php($matches) {     $php = "<strong>PHP:</strong><div style=\"margin:0px 10px;padding:5px;border:1px dotted #000000;width:80%;\"></em>";     $php .= highlight_string($matches[0], true);     $php .= '</em></div>';     //strip out line breaks:     $php = str_replace("<br />", '', $php);     // strip out PHP BBCode tags:     $php = preg_replace("#(\[php\]|\[/php\])#i", "", $php);     return $php; } ?>[/code] Thanks to anyone who can help!
  13. I don't care the best way to do a switch statment, can you help me or not
  14. Please help, my ip banning script is causing a 500 error, here is the script: [code]<? include "site_top.php"; ?> <?php require("config.php"); switch ($_GET[id]) { default: if(!isset($_POST[ban])){ // If the submit button hasnt been pressed echo "<form method='post'> <b>IP Address:</b><br> <input type='text' name='ip' maxlength='50'> <br> <b>Reason:</b> <br> <textarea name='reason' cols='30' rows='5'></textarea> <br> <input type='submit' name='ban' value='Ban IP'> </form>"; } if($_POST[ban]){ // If the submit button is pressed $ip = $_POST['ip']; //Get the name field $reason = $_POST['reason'];//Get the message filed if($ip == NULL || $reason == NULL){ // If either fields are left blank.. echo "A field was left blank, please go back and fix this."; //Echo a field was left blank. }else{ // If neither fields are blank... $postcmt = mysql_query("INSERT INTO `banned` (ip,reason,by) VALUES ('$ip','$reason','$logged[username]')"); //Insert the shout echo "The IP has been banned."; // Echo shout was posted } } $listbans = mysql_num_rows(mysql_query("SELECT * FROM banned ORDER BY id DESC")); if ($listbans < 1) { echo "<br />No bans have been made"; } else { $bans = mysql_fetch_array(mysql_query("SELECT * FROM banned ORDER BY id DESC")); while ($b = $bans) { echo "<br />IP: $b[ip]<br />Reason: $b[reason]<br />By: $b[by]-----<a href=\"ipban.php?id=delete&ip=$b[ip]\">DELETE</a><br />"; } } break; case 'delete': if (!$_GET[ans] && $_GET[ip]) { echo "Are you sure you want to delete this ban? <a href=\"ipban.php?id=delete&ans=yes\">Yes</a> Or <a href=\"ipban.php?id=delete&ans=no\">No</a>?"; } elseif ($_GET[ans] == no && $_GET[ip]) { echo "You desided to keep the ban"; } elseif ($_GET[ans] == yes && $_GET[ip]) { echo "Deleting ban..........."; $delete = mysql_query("DELETE FROM banned WHERE ip = '$_GET[ip]'"); echo "Ban deleted!!"; } else { echo "You have reached a invalid page"; } break; } ?> <? include "site_bot.php"; ?>[/code]
  15. How is it even possible that you are 6.5 years old?
  16. Nor adult or teen, I am 12, preteen, male, name is Ross, started PHP/MySQL when 7, same with C, C++, delphi, HTML(not that good anymore), PERL/CGI, ASP, JSP, ColdFusion, flash, XML, and Java, I'm a whiz at everthing.
  17. OK, I will get straight to the point, I made a tutorial system, and when I went to my second tutorial I saw the first one, see the links: http://vexxon.net/index.php?id=tuts&cat=PHP&tutid=2, anyway here is my code: [code]<?php include('config.php'); // connect to database include('includes/bbcode.php'); if ($_GET['cat']) { if ($_GET['tutid']) { $tutid = $_GET['tutid']; $cat = $_GET['cat']; $query = mysql_query("SELECT * FROM tutorial where id = '$tutid' & tut_type = '$cat'"); $r = mysql_fetch_array($query); echo " <table border=\"0\"> <tr> <td>".$r[tut_name]."</td><td>By ".$r[user]." </tr> <tr> <td>".$r[tut_desc]."</td> </tr> <tr> <td>".bbcode($r[tut])."</td> </tr> </table> "; } else { $acat = $_GET['cat']; $query1 = mysql_query("SELECT * FROM tutorial where tut_type = '$acat'"); if (mysql_num_rows($query1) == 0) { echo "No tutorials in this category"; } else { echo "<table border=\"0\">"; while($s = mysql_fetch_array($query1)) { echo " <tr> <td><a href=\"index.php?id=tuts&cat=".$s[tut_type]."&tutid=".$s[id]."\">".$s[tut_name]."</td><td>By <a href=\"index.php?id=memb&user=".$s[user]."\">".$s[user]."</a></td> </tr> "; } echo "</table>"; } } } else { $query2 = mysql_query("SELECT * FROM tutorialcats"); echo "<table border=\"0\">"; while($t = mysql_fetch_array($query2)) { echo " <tr> <td>- <a href=\"index.php?id=tuts&cat=".$t['name']."\">".$t['name']."</td> </tr> "; } echo "</table>"; } ?>[/code]
  18. The code is my view category, and view tutorial code, it's not working, when I go to the link it shows nothing, observe: www.vexxon.net/includes/tutorials.php
  19. Some one please help me with this: <?php include("config.php"); include("include/bbcode.php"); $sql = mysql_query("SELECT*FROM `tuts_cats` ORDER BY id DESC"); if (!$_GET['cat']) { if (mysql_num_rows($sql) == 0) { echo "No tutorial categories"; } else { echo "<table border=0 width=100%>"; while ($r=mysql_fetch_array($sql)) { echo (" <tr> <td><a href=\"index.php?id=tuts&cat=$r[category]\">$r[category]</td> </tr>"); } echo "</table>"; } } elseif ($_GET['cat']) { $cat = $_GET['cat']; $sql2 = mysql_query("SELECT*FROM `tuts` where cat = '$cat' ORDER BY id DESC"); if (mysql_num_rows($sql) == 0) { echo "No tutorials in this category"; } else { echo "<table border=0 width=100%>"; while ($r2=mysql_fetch_array($sql2)) { echo (" <tr> <td><a href=\"index.php?id=tuts&tut=$r2[id]\">$r2[tutname]</td> </tr> <tr> <td>$r2[description]</td> </tr> "); } echo "</table>"; } } else { $tut = $_GET['tut']; $sql3 = mysql_query("SELECT*FROM `tuts` where id = '$tut'"); $r3 = mysql_fetch_array($sql3); $content = bbcode($r3[content]); echo "<table border=0> <tr> <td>$r3[title] written by <a href=\"index.php?id=memb&user=$r3[author]\">$r3[author]</a></td> </tr> <tr> <td>$r3[description], $r3[tutdate]</td> </tr> <tr> <td>$content</td> </tr> </table>"); } ?>
  20. Hey, I would love to share the usersystem, when I'm done, anyway, can anyone help me with the other things?
  21. [!--quoteo(post=385559:date=Jun 19 2006, 05:10 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 19 2006, 05:10 AM) [snapback]385559[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try this: [code]function bbcode($content) {     $bbcode = array(        "'\[b\](.*?)\[/b\]'",        "'\[i\](.*?)\[/i\]'",        "'\[u\](.*?)\[/u\]'",        "'\[code\](.+?)\[/code\]'",        "'\[url=(.*?)\](.*?)\[/url\]'",        "'\[url\](.*?)\[/url\]'",        "'\[img\](.*?)\[/img\]'",     );     $html = array(         "<b>\\1</b>",         "<i>\\1</i>",         "<u>\\1</u>",         "<strong>Code:</strong><div style=\"margin:0px 10px;padding:5px;border:1px dotted #FFFFFF;width:80%;\"></em>\\1</em></div>",         "<a href=\"\\1\" target=\"_BLANK\">\\2</a>",         "<a href=\"\\1\" target=\"_BLANK\">\\1</a>",         "<img border=\"0\" src=\"\\1\">",     );     $content = preg_replace($bbcode, $html, $content);     // call a dedicated function to highlight our php code.     $content = preg_replace_callback("#\[php\](.*?)\[\/php\]#is", 'highlight_php', $content);     return nl2br($content); } function highlight_php($matches) {     $php = "<strong>PHP:</strong><div style=\"margin:0px 10px;padding:5px;border:1px dotted #FFFFFF;width:80%;\"></em>";     $php .= highlight_string($matches[0], true);     $php .= '</em></div>';     //strip out line breaks:     $php = str_replace("<br />", '', $php);     // strip out PHP BBCode tags:     $php = preg_replace("#(\[php\]|\[/php\])#i", "", $php);     return $php; }[/code] [/quote] You are the greatest, it worked, to see it go to www.vexxon.net/index.php?id=news
×
×
  • 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.