-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Are you using socket_close?
-
-did you echo out your form vars to see if they are what you expect? -did you echo out your queried vars to see if they are what you expect? -be more specific than "it don't work." What is it supposed to do? What is it not doing? What is it doing instead? etc... -please use code tags when posting code.
-
Yes, please PM all female models' contact info directly to me Ack! Good call!
-
Insofar no adult material is posted here nor links to pages containing it there shouldn't be any problems. Yes, please PM all pics/links directly to me
-
[SOLVED] converting numbers to months - not working
.josh replied to richrock's topic in PHP Coding Help
typo in your form values? -
need to see settings.php
-
mysql_insert_id doesn't necessarily have to be under the insert. It grabs the id of the last insert you did, whenever/wherever that was. Problem was that you were trying to pass the query string to it as an argument, when it expects a connection resource (which is an optional argument; it will use the one available by default).
-
I think what he's trying to say is that there is no reason you should have two rows with the exact same info. Get rid of the duplicate row and you'll get rid of this issue....or is UID and COST not the only columns in your table, and those two rows have different values somewhere else?
-
http://us3.php.net/manual/en/function.array-map.php#70710
-
parse it for what?
-
Needles in Haystack, no idea how to parse / break apart...
.josh replied to edwardtilbury's topic in PHP Coding Help
@flyhoney: Anyways, dunno about it being a "very nice" solution... I personally would opt for the regex route. I was just being silly. And on that note... Use the regex solution just alter it to only grab numbers between parenthesis. -
Needles in Haystack, no idea how to parse / break apart...
.josh replied to edwardtilbury's topic in PHP Coding Help
haha it was supposed to be used to decide whether to inc $n or not but I decided who cares just array_values it and then forgot to take it out. -
Needles in Haystack, no idea how to parse / break apart...
.josh replied to edwardtilbury's topic in PHP Coding Help
It's no contest. I won, end of story. I mean, I have sh!t in there I don't even know what it's there for. You just can't beat that! -
Needles in Haystack, no idea how to parse / break apart...
.josh replied to edwardtilbury's topic in PHP Coding Help
I am obviously the winner here. <?php $var = "This complete set include the following parts: (12345), (12346), (12347)"; $n = 1; $p = false; for ($x = 0; $x < strlen($var); $x++) { if (is_numeric(substr($var,$x,1))) { $nums[$n] .= substr($var,$x,1); $p = true; } else { $p = false; $n++; } } $nums = array_values($nums); print_r($nums); ?> -
errors are because the query is failing. $sql = "SELECT * FROM users WHERE username='$username' LIMIT 1"; echo "$sql <br/>"; $query=mysql_query($sql) or die(mysql_error()); does $sql print what you expect it to? what does mysql_error say? You can nest the query inside the num_rows (though you shouldn't, due to it being poor coding, such and all...)
-
it is a case insensitive search. It will match Suck sucK SucK SuCk SUCK suck but not a literal *'s instead of letters or spaced out letters or special chars that look like the letters, etc.. s*ck su ck svck etc...
-
how about getting rid of all those foreach loops and using str_ireplace instead?
-
[SOLVED] Regular Expression in PHP using preg_split?
.josh replied to fredroines's topic in Regex Help
If that's how your string is going to always look like, you could still just use explode and then glue elements 3 and 4 back together... -
yes, but also put the posted info into a session var in formb before the header, and back on forma.php echo the session vars out as the input values. example: test.php <?php session_start(); echo <<<FORMENT Page 1 Form Stuff <br/> <form action = 'test2.php' method = 'post'> a <input type = 'text' name = 'a' value = '{$_SESSION['t1info']['a']}'><br/> b <input type = 'text' name = 'b' value = '{$_SESSION['t1info']['b']}'><br/> c <input type = 'text' name = 'c' value = '{$_SESSION['t1info']['c']}'><br/> <input type = 'submit' name = 'submit' value = 'save'> <input type = 'submit' name = 'submit' value = 'next page'> </form> FORMENT; ?> test2.php <?php session_start(); if ($_POST['submit'] == 'save') { // save stuff do db here foreach($_POST as $key => $val) { $_SESSION['t1info'][$key] = $val; } header("Location: test.php"); exit(); } echo <<<FORMENT Page 2 Form Stuff <br/> <form action = 'test3.php' method = 'post'> d <input type = 'text' name = 'd' value = '{$_SESSION['t1info']['d']}'><br/> e <input type = 'text' name = 'e' value = '{$_SESSION['t1info']['e']}'><br/> f <input type = 'text' name = 'f' value = '{$_SESSION['t1info']['f']}'><br/> <input type = 'submit' name = 'submit' value = 'save'> <input type = 'submit' name = 'submit' value = 'next page'> </form> FORMENT; ?> Or alternatively... same thing with the save/next page submit buttons and header, but instead of session vars, on the top of each page you could run a query to see if there's info in the db and if there is, put that in the value = '..'
-
when what changes?
-
You can name a submit button 'save' or whatever and have it post like regular but check for what submit button was pushed. if it was the 'save' button you can have the script save the posted info into the db, assign the info to a session array, and header back to the previous page and fill in the blanks with the session array.
-
http://www.webappsec.org/projects/articles/091007.txt
-
look into AJAX