rarebit
-
Posts
1,002 -
Joined
-
Last visited
Posts posted by rarebit
-
-
Some code might be helpful?
-
global $counter
Put it in the function...
-
Here's food for thought!
for($i=0;$i<10;$i++) { echo (($i % 2) == 0) ? 'foo' : 'bar'; }
-
$i will only ever equal $numrows once!
-
What's being used to stream the darta?
-
From my suggestion add everything from the ? to the end of yours (inc the ?). That's the GET bit!
-
see http://dev.mysql.com/doc/refman/5.0/en/truncate.html
It's just something you have to live with...
-
Are you calling the page with something like this:
-
Well if you've got no button then you won't have either of those variables set!
-
What's calling the page then?
-
The 'isset' is checking for a GET variable, probably from a submit button from a form. And for the other variable, put in any address you want, it's just something to display if the submit button wasn't used to access the page.
-
Script should work, what's the error, what's happening???
-
This should help inform you:
<?php if(isset($_POST['test'])) { echo "passed<br>"; } if ($_POST['test'] == NULL) { echo "something<br>"; } if(empty($_POST['test'])) { echo "pass<br>"; } print "<html><head></head><body>"; print "<form action='test2.php' method='POST'><input type='text' name='test'><input type='submit' value='send'></form>"; print "</body></html>"; ?>
-
Not sure of the question... here's the manual, which has some examples of parsers...
http://uk.php.net/manual/en/ref.xml.php
Need to know more to explain more...
-
Code looks ok from firefox and I suppose you've run it through the w3c validator, if that say's it's ok then dunno. You could do with some more '\n', so can read better to make sure all tables open/close... At least something should show in IE, otherwise it's a server or address error?
-
Sample code for table creation:
CREATE TABLE tn { postDate int, etc };
Insert it:
$postDate = time(); $result = mysql_query("INSERT INTO tn VALUES (x, y, z, '$postDate'");
Query:
$result = mysql_query("SELECT * FROM postData ORDER BY postDate");
-
It works!
<?php function bbcode_format($post) { $post = htmlentities($post); $simple_search = array( '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[center\](.*?)\[\/center\]/is', '/\[right\](.*?)\[\/right\]/is', '/\[img=(.*?)\]/is', '/\[(.*?)\](.*?)\[\/url]/is', '/\[colour=(.*?)\](.*?)\[\/colour]/is', '/\[quote\](.*?)\[\/quote]/is', '/\[br]/is', '/\[hr]/is', '/\[h1](.*?)\[\/h1\]/is', '/\[h2](.*?)\[\/h2\]/is', '/\[h3](.*?)\[\/h3\]/is', '/\----/is', '/\----/is', '/\----/is', '/\----/is' ); $simple_replace = array( '<strong>$1</strong>', '<em>$1</em>', '<u>$1</u>', '<center>$1</center>', '<right>$1</right>', '<img src="$1">', '<a href="$1">$2</a>', '<font color=$1>$2</font>', '<br><table border=0 bgcolor=#000000><td>$1</td></table><br>', '<br>', '<hr>', '<h1>$1</h1>', '<h2>$1</h2>', '<h3>$1</h3>', 'f***', 's***', 't***', 'c***' ); // Do simple BBCode's $post = preg_replace ($simple_search, $simple_replace, $post); return $post; } $post = "[b]hello[/b]"; $p = bbcode_format($post); echo $post."<br>"; echo $p."<br>"; ?>
-
I don't quite understand what your saying, but you can see your current session for that site by using your browser, that store's the SID as a session cookie? If your on about using some code on other ppl's website then you really need to think some more!
-
How do you mean finish the script?
-
If you want the url to be rewritten use mod_rewrite (an apache module), otherwise you could redirect (with 'header') or just include b in a...
-
Easiest way is to store date as you get it from time(), e.g. as a unix timestamp. This is basically returns an int, which is great for comparing things to. Then when you wish to show the user, then you format it to a specific format, this is because it may be different depending upon timezone etc...
The way your doing it is ordering them by the the numeric value of the character string and the way they sum up is not in the same order as the way the months, days, etc are spelled! (if that's clear?)
-
dirname() just returns the path part of a filename...
Are you wanting:
if(strcmp($fn, "a.php") == 0) { require_once("a/a.php"); } elseif(strcmp($fn, "b.php") == 0) { require_once("a/b/b.php"); }
-
Try:
if(!fgets(STDIN))
-
Mailing List Manager Pro
in PHP Coding Help
Posted
Use the back button, or just go somewhere else!