-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
lame. what's the fun in doing a challenge when you're asking for other people to do it for you?
-
trim dude are you even gonna try and work this out on your own or are you just gonna like, ask for help every step of the way?
-
Oh do you mean define as in initialize them? function chunk ($array, $size) { if (!is_array($array)) return false; $chunk = 0; $pos = 1; foreach ($array as $key => $val) { if (!$newArray[$chunk]) $newArray[$chunk] = array(); $newArray[$chunk][$key] = $val; if ($pos % $size == 0) $chunk++; $pos++; } // end foreach return $newArray; } // end function chunk
-
what do you mean by 'define the subarrays'
-
well, you wouldn't technically need ajax. Ajax would just allow you to click the button and send a request to the script without refreshing the whole page. You can do it with a regular html form or link and just have the whole page refresh.
-
You would need to setup an interface to send commands to be used with those various functions genericnumber provided. You can make a form with a text field or text area or dropdown or whatever, and use the posted info in one of those functions. Or you could make links that send command string via GET method. Or if you're looking for a more real-time solution like if you were to be working from the command prompt, you could look into doing it with ajax.
-
I personally validate with good old fashioned regex.
-
yeah it seems to work for me now too. I was having an anxiety attack. I was thinking about going to msn.com's search and I started feeling dirty. I think I will go take a shower now. And scrub thoroughly.
-
new and images and shopping..looks like everything but 'web' search is fine...
-
Okay so I woke up this morning and did my first google search of the day for something or other, and underneath every page result I get a "This site may harm your computer" link. wtf? No matter what I enter into google.com, every single site listed has that message underneath the site link. Even www.google.com has that message listed! It's a link that takes you to some page saying: Anybody know wtf is up with this? Some new thing google is trying out and horribly failing at? How the hell do I make it stop?
-
To expand on that, unless you are pulling like 1 specific column of one specific row from your database, it is a lot faster to use a mysql_fetch_xxx function rather than mysql_result, because those functions will pull all of the columns of the row in one call, instead of doing one for each column.
-
You use that to escape quotes to prevent (most) sql injection attacks. You are supposed to validate data going into the database, so there shouldn't be a reason to validate it going out.
-
okay OP asked if he had to use dreamweaver, and this thread has gone from a simple yes or no answer to people endorsing other editors (pointing the finger at myself, too). Since we already have a sticky for this, thread closed.
-
What is that supposed to translate to? Maybe the problem is that you aren't using the right content charset type?
-
what is the column type you are using to store the password has in?
-
I understand you wanting to shy away with showing your real code because you use pear. You may receive little or no response from posting your real code, but you will certainly receive nothing helpful by not posting it.
-
The error is because you are trying to use echo inside your quotes. Change each of these: echo($_POST['title']) to {$_POST['title']}
-
okay well doing a mysql_query returns a result source. You actually have to pull the info out of the result source with mysql_result or mysql_fetch_assoc or mysql_fetch_row
-
Was there a question in there somewhere?
-
I don't see where you are assigning anything to $a[0]
-
preg_match_all('~<code>(.*?)</code>~s',$string,$matches);
-
also, if you don't have php5+ you can use range instead: $letters = range('a','z');
-
actually, you need to be using { } $stringofletters = "abcdefghijklmnopqrstuvwxyz"; echo $stringofletters{4}; // output: e but looking at your code, if you have php5+ you can just use str_split to accomplish the same thing.
-
example of single vs. double quotes: $name = "Joe"; echo 'hi $name'; // output: hi $name echo "hi $name"; // output: hi Joe notice how the single quotes literally output '$name', vs. the double quotes outputting the value of $name.
-
In your form, make sure each form element has name='nameofvariablehere' in it. Make sure to use the post method for your form (inside your form tag, do method='post'). In your processing script (the one you posted), use $nameofvariablehere = $_POST['nameofvariablehere']; // <--vars will be in $_POST array Beyond that... In your array you are using single quotes around your variables. Single quotes causes php to interpret the string literally. If you want it to use the value of the variable instead of the literal variable name, use double quotes. Or better yet, since you are wanting each array element to be only the variable values, don't use quotes at all. But then again, I don't really see the point in making an array out of all your variables in the first place, seeing as how you turn around and implode it. Just make a single string in the first place.