Jump to content

maxudaskin

Members
  • Posts

    628
  • Joined

  • Last visited

Everything posted by maxudaskin

  1. What is the point of a class? How do you use it? What are it's proficiencies? What are it's main drawbacks?
  2. Please post the whole script.
  3. I really dislike the scattered rounded boxes. For those who are too lazy to sign up to view the members part: My Likes: Music Player with Fundobox logo - loose the logo, make it more secure so people cannot steal it My Dislikes Using premade software for the News - Especially one with another site's logo on it
  4. That wasn't code, it was just a visualization. But that just may be crazy enough to work.
  5. I know it is possible (in some way) to figure out the number of weeks in a month, but not in the way you are probably thinking. What I want to do is make a calendar for my website. I don't want to use a pre-made script because I want (I want a lot of things ) to make my whole site integrated and have it look good together. I want to be able to figure out how many weeks a month falls under if a week is: Sun, Mon, Tue, Wed, Thu, Fri, Sat If a month was to start on a Thursday and last 31 days, then it would have 5 weeks as illustrated below. Sun, Mon, Tue, Wed, Thu, Fri, Sat 1: 1 2 3 2: 5 6 7 8 9 10 11 3: 12 13 14 15 16 17 18 4: 19 20 21 22 23 24 25 5: 26 27 28 29 30 31
  6. You mean, force someone to download a file to their computer, even if they don't want to? Nobody will help you do that because it is illegal. If these are not your intentions, please post more information about what you want.
  7. <form name="form" action="index.php" method="get"> <b>Filter cars:</b><br> <select name="car"> <option <?php if(empty($_GET['car'])){ echo "selected=\"selected\""; } ?> value="">DISPLAY ALL</option> <option <?php if($_GET['car'] == "honda"){ echo "selected=\"selected\""; } ?> value="honda">honda</option> <option <?php if($_GET['car'] == "toyota"){ echo "selected=\"selected\""; } ?> value="toyota">toyota</option> <option <?php if($_GET['car'] == "ford"){ echo "selected=\"selected\""; } ?> value="ford">ford</option> </select> <input type="submit" value="Go"> </form> OR <form name="form" action="index.php" method="get"> <b>Filter cars:</b><br> <select name="car"> <option value="">DISPLAY ALL</option> <?php $values = array("Honda","Toyota","Ford"); $num_vals = count($values); for($i = 1,$i <= $num_vals, $i++){ if($values[$i] == $_GET['car']){ echo "<option selected=\"selected\" value=\"$value[$i]\">$value[$i]</option>"; }else{ echo "<option value=\"$value[$i]\">$value[$i]</option>"; } } ?> </select> <input type="submit" value="Go"> </form>
  8. I wrote this, but it won't seem to work for me. I want to (let * be a variable) take the first variable from code one and put them into another array. There may be multiple instances that I want to take (lets say each line has a different variable that I want to take). [" * "]*²[/" * "] [" * "]*²[/" * "] [" * "]*²[/" * "] I got this, but it gives me an error. <?php /*******************************************/ /* */ /* Written by Max Udaskin */ /* */ /* [email protected] */ /* */ /*******************************************/ /* */ /* No part of this script may be used */ /* without written consent of the original */ /* author himself and nobody else. */ /* */ /*******************************************/ // Open, Read and Close the file $file = fopen("constants.txt","r"); $contents = fread($file,filesize("constants.txt")); fclose($file); // Set Variables $varnames = preg_replace("/\[(.+?)\]/*\[/(.+?)]/","$1\n",$output); echo $output; ?> Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/.grable/vzoom/virtualzoom.net/email/emailer.php on line 22
  9. I am not sure what you are asking, but this might help. $gender = empty($_POST['gender']) ? "Unknown" : $_POST['gender'];
  10. $query = mysql_query("SELECT * FROM `table` WHERE `column` = 'value' ORDER BY `column` DESC"); $rows = mysql_num_rows($query) If the query brings up 3 results, then $rows will be set to 3.
  11. Thank you. It worked.
  12. I made a forum, and I decided that a quoting system was in order. I quietly edited the bbcode list and now I was wondering: Can I make it multi-line? (See image 1 and 2) Can I put a quote in a quote? (See image 3) Image 1 Text This is a quote test. [quote]This is quoted text.[/quote] This is a colour test. [blue]The is blue.[/blue] [red]This is red.[/red] Current Project: [b]Debugging Quote System[/b] Image 2 Text This is a quote test. [quote]This is quoted text. This is a second line.[/quote] This is a colour test. [blue]The is blue.[/blue] [red]This is red.[/red] Current Project: [b]Debugging Quote System[/b] Image 3 Text This is a quote test. [quote]This is quoted text.[quote]This is a quote inside a quote.[/quote][/quote] This is a colour test. [blue]The is blue.[/blue] [red]This is red.[/red] Current Project: [b]Debugging Quote System[/b] Source Code (Amended) <?php $text = $posts['text']; $message = preg_replace($find,$rplc,$text); preg_match_all('/\[img\](.+?)\[\/img\]/', $text, $url); $imagekeys = array_keys($url[1]); for($i=0;$i<count($imagekeys);$i++){ echo "<img src\""; print_r($url[$i][0]); echo "\" height=\"" . $height . "\" width=\"" . $width . "\" alt=\"We Cannot Find This Specified Image\" /><br />"; } $message = str_replace($smilies,$locations,$message); $pattern = '% (http://)? ### optional http:// prefix (?(1)|www\.) ### require www. if there is no http:// \S+ ### gobble anything but white space %x'; $message = preg_replace_callback($pattern, 'clickable_short_url', $message); // Change URLs into links echo nl2br($message); ?> <?php // BBCode $find=array( "/\[b\](.*)\[\/b\]/", "/\[i\](.*)\[\/i\]/", "/\[u\](.*)\[\/u\]/", "/\[img\](.*)\[\/img\]/", "/\[link\](.*)\[\/link\]/", "/\[big\](.*)\[\/big\]/", "/\[small\](.*)\[\/small\]/", "/\[red\](.*)\[\/red\]/", "/\[blue\](.*)\[\/blue\]/", "/\[green\](.*)\[\/green\]/", "/\[quote\](.*)\[\/quote\]/" ); $rplc=array( "<b>$1</b>", "<i>$1</i>", "<u>$1</u>", "<img src='$1'/>", "<a href='$1'>$1</a>", "<h1>$1</h1>", "<h4>$1</h4>", "<font color='red'>$1</font>", "<font color='blue'>$1</font>", "<font color='green'>$1</font>", "<div class='forumquote'>$1</div>" ); ?> Style .forumquote { text-align: left; background: #efefef; color: #333; border: 1px inset #333; font-family: "Courier New", Courier, monospace; padding: 5px; margin: auto; width: 90%; max-height: 200px; overflow: auto; } Image 1 Image 2 Image 3
  13. DVA has an amazing script, but horrible design.
  14. I have a simple script (below), but instead of doing the math and echoing the quoted stuff as is and the math functions completed, it echoes the same thing all the time. for i : 1..5 58 end for <form name="form1" method="post" action="<?php echo $PHP_SELF; ?>"> <label>Type of Ship <select name="type" id="type"> <option value="carrier">Aircraft Carrier</option> <option value="btlship">Battleship</option> <option value="destroy">Destroyer</option> <option value="submarn">Submarine</option> <option value="patrolb">Patrol Boat</option> </select> </label> <br> <label>Orientation <select name="orient" id="orient"> <option value="vert">Vertical</option> <option value="hori">Horizontal</option> </select> </label> <br> <label>Start <select name="s_x" id="s_x"> <option value="0">A</option> <option value="1">B</option> <option value="2">C</option> <option value="3">D</option> <option value="4">E</option> <option value="5">F</option> <option value="6">G</option> <option value="7">H</option> <option value="8">I</option> <option value="9">J</option> </select> </label> <label> <select name="s_y" id="s_y"> <option value="0">1</option> <option value="1">2</option> <option value="2">3</option> <option value="3">4</option> <option value="4">5</option> <option value="5">6</option> <option value="6">7</option> <option value="7">8</option> <option value="8">9</option> <option value="9">10</option> </select> </label> <br> <label> <input type="submit" name="Submit" value="Submit"> </label> </form> <?php if(!empty($_POST['Submit'])){ if($_POST['type'] == "carrier"){ $length = 5; }elseif($_POST['type'] == "btlship"){ $length = 4; }elseif($_POST['type'] == "destroy"){ $length = 3; }elseif($_POST['type'] == "submarn"){ $length = 3; }elseif($_POST['type'] == "patrolb"){ $length = 2; } echo "for i : 1.." . $length . "<br />"; if($_POST['orient'] == "vert"){ echo $_POST['type'] . "_x(i,1) := " . $_POST['s_x'] * 25 + 2 . "<br />" . $_POST['type'] . "_x(i,2) := " . $_POST['s_x'] * 25 * $length + 27 . "<br />" . $_POST['type'] . "_y(i,1) := i * 25 + " . $_POST['s_y'] * 25 + 2 . "<br />" . $_POST['type'] . "_y(i,2) := i * 25 + " . $_POST['s_y'] * 25 + 27; }elseif($_POST['orient'] == "hori"){ echo $_POST['type'] . "_x(i,1) := i * 25 + " . $_POST['s_y'] * 25 + 2 . "<br />" . $_POST['type'] . "_x(i,2) := i * 25 + " . $_POST['s_y'] * 25 + 27 . "<br />" . $_POST['type'] . "_y(i,1) := " . $_POST['s_x'] * 25 + 2 . "<br />" . $_POST['type'] . "_y(i,2) := " . $_POST['s_x'] * 25 * $length + 27; } echo "<br />end for"; } ?>
  15. What would you personally do to make it better?
  16. Put in echo mysql_num_rows($result); then post what it says.
  17. I am redesigning my website and I need your help to figure out what I need... Current: http://www.virtualzoom.net Please Critique. New One (Incomplete): http://virtualzoom.net/new/ Please Critique.
  18. C++(or some client side program) => AJAX => PHP
  19. What I'd do is this: <?php $password = "password"; $password = md5($password); // 319f4d26e3c536b5dd871bb2c52e3178 $password = substr($password,0,16); // 319f4d26e3c536b5 // For extra security, do it again $password = md5($password); // ce90da7acc4c917baa12b361b4d1a126 $password = substr($password,0,16); // ce90da7acc4c917b ?>
  20. I have seen it done... http://www.md5oogle.com/ Put c321da05a0593d465ffe67159f41def6 in.
  21. No... $_POST is when your form method is post. $_GET is when your form method is get. All variables are confined to a function if they are created in one, unless you use global to change it from a local variable (in one function) to a global variable (used in the whole script). <?php function localVar(){ $localvar = "local"; echo "localVar : " . $localvar; echo "<br />"; } function globalVar(){ global $globalvar; $globalvar = "global"; echo "globalVar : " . $globalvar; echo "<br />"; } localVar(); globalVar(); echo $globalvar . " | " . $localvar; ?> outputs localVar : local globalVar : global global |
  22. All I want from the script is a flat mark out of ten so I can multiply it by 0.01 and get the percentage. I am going to be working with the percentage. <?php $mark = $mark / 10 * 100; ?>
  23. Wouldn't !empty be what you are looking for, not isset?
×
×
  • 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.