Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. PHP source code cannot be grabbed unless the creator makes in available in a php-source MIME type usually has the extension [b].phps[/b] PHP means Hypertext PreProcessor...so think of it as an HTML generator you make code to either logically make HTML code, or systematically make it. If someone did you a program to steal a PHP file like flashGet or getright all they would attain is the preprocessed HTML and as for your vocab questions 1.INT = a number type 2.NOT = self explanatory 3.NULL = nothing 4.AUTO INCREMENT = increment by one for every row
  2. Same here, although I'm like a grammar Nazi. I'm pretty considerate when it comes to someones question, I see no point in changing the subject to something stupid like a mispelled word rather than their main perogative. I speak both spanish and english so I know how hard it can be to sound...not foreign, in the spanish perspective for me. like ober said, if you can get [b]your[/b] idea of a [b]question across[/b] in whatever words it takes, it will be answered.
  3. this would be the regex for it [code]ereg_replace("<a.*mailto:(.*)".*>(.*)</a>", "<a href="<?=$offset?>/mail.php?email=\\1">\\2</a>", $matches); [/code]
  4. you need to merge your background into one image you just need a line about 1024px wide and maybe 5px tall then you can do this [code]    body{         font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;         font-size:0.5em;         margin:0px;         padding:0px;         text-align:center;         background-image: url("background.jpg");                 background-repeat: repeat-y;         align:left;     }[/code]
  5. you'd do it this way...for dynamic variables [code]$arrays = "graphValues" . $c; $$arrays[]=$row['RATING'];[/code] but yeah kenrbnsn is right a multi-dim array would work more smoothly
  6. you could much easier do the IF in the query itself like so [code] $sql = " IF ( SELECT name FROM bUser where name = '$name' IS NULL ) THEN      INSERT INTO bUser Values ('$name','$mail'); ELSE      UPDATE bUser SET email = '$mail' where name = '$name'; END IF; "; mysql_query($sql);[/code] I think that should work
  7. you can get a zip code database here [a href=\"http://civicspacelabs.org/home/releases/civicspace/civicspace-0.8.3.zip\" target=\"_blank\"]http://civicspacelabs.org/home/releases/ci...space-0.8.3.zip[/a] download it, extract it, and look through the folders for the zipcodes.sql file or something like that you'll have to INSERT them like 400 to 600 at a time on your MySQL server depending on your CPU speed. but that's a place to find the zipcodes and there a plenty of free script templates for distance most all free it's about 7 or so lines of code
  8. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]do you mean creating a function on-the-fly???[/quote] I think he means that he wants to call functions from within a function just do it like you think you would [code] function Test() { return "function 1"; } function Test2() { return "function 2"; } function MainFunction() {   $msg = Test();   $msg .= Test2();   return $msg; } echo Main(); //returns function 1function2 [/code]
  9. try doing it like this $sql = mysql_query("INSERT INTO elemento ( ele_tec, valor, id_potencia) values ('[b]{$ele_tec}[/b]', '[b]{$valor}[/b]','[b]{$id_potencia}[/b]')"); note the curly braces
  10. really...you don't need a testing server a testing server is for when you are publishing to a remote server you create a testing server that is....hopefully...identical in it's settings....so you know [b]before[/b] you publish it if it will work but since you're doing it on localhost you just need to tell it where you're local files are and just...forget about the testing server or cloaking server or anything else besides your local files.
  11. The most blunt question is.. "What would you like to see on the page"... so you can rule out what will be script and what you really have to worry about...what's being displayed If they can't answer then ask What they're offering on the site....that's so special they need a site. It's pretty much winging it anyway you go but sometimes the dumbest questions in your perspective turn out to give the best answers.... I always bring a paper and pencil with me to map out where certain things could go.....in front of them Good Luck PS...this isn't a PHP question, I'm moving it to the Misc forum please watch where you post
  12. you can use the parse_str function to separate all you're vars if I think that's what you want to do [code]print_r(parse_str($_SERVER['REQUEST_URI']));[/code]
  13. somewhere in your equip_list.php file you are telling it to do something like this I assume [code]$sql = "SELECT * FROM sometable WHERE subcat = '" . $_GET['subcat'] . "'";[/code] you need to have it do this instead [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$sql = "SELECT * FROM sometable WHERE subcat [b]LIKE [/b]'" . $_GET['subcat'] . "'";[/quote] so just change you link to go to [a href=\"http://www.rcubed.com/equip_list.php?item_code=SONIC&sub_cat=app%\" target=\"_blank\"]http://www.rcubed.com/equip_list.php?item_...IC&sub_cat=app%[/a] after you have changed your PHP script
  14. Zane

    Problem

    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Also the code is really long and i need to add about 8x more stuff in so i was wondering if anyone could shorten it a bit please.[/quote] you can't just post code and ask us to fix it up for you.... you need to shorten it yourself and then explain what you need help on and FYI your problem is that you're putting the row for NAME PRICE etc inside your while loop start the table first then put the while loop and end the table after the loop
  15. you're topics being moved to the CSS Forum
  16. hmm....learn something everyday well I guess you'd have to do this then wolves [code] class foo {   public $string = foo::bar();   public function __construct($str = $this->string) {            echo $str;     }   public static function bar() {       return "hello";   } }[/code] notice it's still static
  17. how are you sending the Search to the URL first of all and secondly what code are you using to Search from the url helps more if you provide some code my guess is that when you are searching from what's shown in the URL you're assuming subcat is always equal to it's value it that's the problem you should have it look at the value.....(likeapp%)...first and then tell it to say..... WHERE subcat LIKE 'app%' instead of WHERE subcat = 'likeapp%' LIKE works just as good as equals...especially when you're going to be using wildcards
  18. I would think that would work at first glance, but class integration with a regular PHP file is kinda hectic anyway I would say if it doesn't work, you could *grits teeth* make it global most of the time it's not a good idea to make things global but if it works it works and the best alternative I could think of would be to make the function bar just a static method in your class but that just depends on how much bar() has to do with the class at all see example [code] class foo {   public function __construct($str = foo::bar()) {            echo $str;     }   public static function bar() {       return "hello";   } }[/code] [!--quoteo(post=362550:date=Apr 7 2006, 11:29 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 7 2006, 11:29 AM) [snapback]362550[/snapback][/div][div class=\'quotemain\'][!--quotec--] You cannot call a function when when using parameters. [/quote] are you sure....I've never ran into such a problem as what wolves is doing but I would think that you could very well use a function to declare an argument value it works for any other function [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] echo date("g:m", [!--coloro:#FF6600--][span style=\"color:#FF6600\"][!--/coloro--]strtotime()[!--colorc--][/span][!--/colorc--]) [/quote] but maybe classes are a different story I dunno...I'm not on my own machine
  19. on your input boxes..the HTML part change the name of each box to something like whatever[]...note the brackets the when the form is sent you'll have a 0 to 15 list of all the input in an array called whatever [code]A<input name='stuff[]' type='text'> B<input name='stuff[]' type='text'> C<input name='stuff[]' type='text'> D<input name='stuff[]' type='text'> //$stuff[2] would be the C one [/code] anyway...once you do that...do a foreach loop with it to make sure each one is unique and if it is just continue if not.....stop everything I guess and throw your error say [code]foreach($stuff as $val) [ if(in_array($val, $stuff))    die("ERROR"); }[/code]
  20. Yes, you can do this Same script but modified [code]function loop_thing(){ //sql query stuff here $results = array(); $i = 0; while($row = mysql_fetch_array($sql_r, MYSQL_NUM)){      $results[] = $row[$i]; } return $results; } //then to output: $results = loop_thing(); echo $result[0]. "<br>"; echo $result[1]. "<br>"; echo $result[2]; [/code]
  21. the header function has to be used before ANY output to the browser and all this is output [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<p> </p> <form name="form1" method="post" action=""> <p>login (email): <input type="text" name="em"> <input name="pass1" type="password"> <input name="submitf" type="submit"> <input name="resetf" type="reset"> </p> </form> <p> </p>[/quote] I'm surprised you're not getting a "Cannot modify header" error
  22. use the is_null() function [code]if(is_null($var) || is_null($anotherVar))[/code]
  23. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I was wondering how you guys made the code block[/quote] well...we didn't make it first of all and most likely regex was used to do it all it is is it replaces stuff between [code] with a formatted div tag whilst removing the code tag and then they CSS to make it look prettier
  24. This could work as well it will delete every key that has a matching one in the other table...leaving the 'unrelated' ones as I assume you wanted [code] DELETE FROM cvs, jscvs USING cvs, jscvs WHERE cvs.id = jscvs.id;[/code]
  25. go to [a href=\"http://php.net/addslashes\" target=\"_blank\"]http://php.net/addslashes[/a] and learn the function it should fix it all up
×
×
  • 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.