AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Handling information from a database is a bit different then grabbing data from a static array. But as to your question, using inline styles should typically be avoided on large scale projects, as this will lead to alot more code then is necessary. Typically you want to use classes and id's to style elements using one ore more external style sheets. The author of this code probably just styled them inline for a quick example.
-
Obviously the number of rows being grabbed is 1. If this is not what you expect to be returned, then something is wrong with your query. It's hard to help any further without actually seeing the query. What data does the user have to enter in order to login?
-
that isn't an array I don't quite understand what you are asking, a foreach loop is fine for looping through an array.
-
It really depends on how much of the information that you have "learned" you actually understand and are confident using, and yes I agree with thorpe regarding the topic you posted in, which I commented on before I saw this thread. All that we have to base your knowledge off of is posts on this forum, seems like you have a ways to go. My advice would be instead of trying to cram as many languages in as you can, focus on becoming proficient in each language one at a time. Once you feel that you have a firm understanding of one, move on to the next.
-
How can I achieve this in OOP PHP the right way?
AyKay47 replied to mds1256's topic in Application Design
just...no I agree it is a pain sometimes, but it's the correct way to do it. Never use the global keyword. -
couldn't you have tested this yourself?
-
lol, geeze
-
you do realize that the basis of ajax is the use of this object right?
-
<div class="content">content<div> you missed the closing div tag, should read <div class="content">content</div> http://jsfiddle.net/hZ6nQ/
-
remove the break; that you have in the else condition. If $sig[0] does not match, the break; will break you out of the for loop and no other $sig values will be compared. $string = 'TESTSTRING!! I AM AN EMAIL TEXT!!! SO RANDOM! --- I AM A SIGNATURE!! HERP DERP CUT ME OFF'; //define possible sig starts (=filter) $sig[0]=("#=="); $sig[1]=("---"); $sig[2]=("the name of an enterprise"); $sig[3]=("___"); for ($i=0; $i <= count($sig); $i++) { $sigpos = strpos($string,$sig[$i]); if($sigpos !== false) { $string = substr($string,0,$sigpos); echo trim($string); break; } } echo "<br />"; //show where the sig is cut off echo $sigpos; ?>
-
very well could have, I guess I will have to use a header to get to the proper content-type. Thanks for the help.
-
right but I shouldn't need to do that every time. things like this used to work fine on codepad.viper-7. I guess they changed the content-type from text/plain
-
search for it on google.
-
this isn't really the right solution. Dates should be stored in a DATE or DATETIME type field in the database.
-
heh, yeah sure. http://codepad.viper-7.com/20Gd51 it seems that tags are now stripped or something of the sort. The behavior seems kind of random to me, as sometimes it parses the string fine and sometimes its stripped. This behavior did not occur until maintenance was performed on the site about 2 weeks ago.
-
this will allow anything to come before or after the href attr. Things can be added to this, depending on where its coming from.
-
remove the end >
-
Is anyone else noticing unexpected behavior with regex functions like preg_match() etc. on codepad.viper-7.com? A few tests I have performed have not shown any results at all. A pattern like '~.*~'; isn't matching anything when the $subject argument is certain things, other times it will match everything in the $subject argument, very strange. I haven't ran enough tests to determine what exactly in the $subject arguments is causing this, just wondering if anyone else has experienced this.
-
*untested* $pattern = '~<a.*?href=".+?\?N_ID=(\d+)">~';
-
the problem is this line: $season = $k['season']; so if the season if 1, at the end of the first iteration of the for loop, $season will be set to 1, and the next iteration of season 1 episode 2, this line will not pass: if($season!=$k['season']) { so your credentials will not be wrapped in the season div. I'm not sure of the logic for this, but it needs changed.
-
that or what thorpe suggested.