RussellReal
Members-
Posts
1,773 -
Joined
-
Last visited
Everything posted by RussellReal
-
ace, it doesn't HAVE to be, if the id corresponds to the result in the database, then it should work regardless.. do this noob <?php session_start(); require('connection.php'); $id = $_SESSION['move_id']; print_r(mysql_fetch_assoc(mysql_query("SELECT * FROM `abcxyz` WHERE `id` = '{$id}'"))); ?> and tell me what you get
-
preg_replace("/\.\d{1,3}$/",'.xxx','123.230.192.222'); sorry.. use this instead
-
preg_replace("/\.\d{1,3}$/",'xxx','123.230.192.222');
-
[SOLVED] Unexpected T_STRING What is going on here!?
RussellReal replied to TGWSE_GY's topic in PHP Coding Help
I think whats happening, your script is rendering 'die' as a string not as a function, do die(mysql_error()); instead of die mysql_error(); -
You just do like // put class here // replace 'the_text_field' with the name of the tags textarea $text = explode(' ',str_replace(array('\'','the','and','or',',',' '),'',$_POST['the_text_field'])); $tags = new TagCloud($text); echo $tags->get_cloud();
-
authenticate over a url for a web service
RussellReal replied to nadeemshafi9's topic in PHP Coding Help
Why isn't it that simple? -
authenticate over a url for a web service
RussellReal replied to nadeemshafi9's topic in PHP Coding Help
Y use urls, why not just establish a socket connection between both servers and then just send data thru the socket -
[SOLVED] Present document outside of web path for download
RussellReal replied to JD*'s topic in PHP Coding Help
you need to access the file with PHP, you can't direct your user's client to the file.. and it isn't that hard say its 1 directory back from the website's base directory you'd just do $filename = '../'.$filename; and then fopen, fread, and then set the mimetype of the document and I think its uhm application/pdf or sumfin like that, using header() for example header('Content-Type: Application/PDF'); and then echo all the data you got from the file into the page and then the page should either act like a download of the pdf file, or open it in the web browser acrobat reader addon thingy -
I just worked something out for you.. <?php // BY Russell Crevatas // CONTACT email/msn RussellonMSN@hotmail.com class TagCloud { private $tag_count = array(); private $tag_formatted = array(); private $min_size = 10; private $max_size = 40; public function __construct($tags) { foreach ($tags as $v) { if ($this->tag_count[strtolower($v)]) $this->tag_count[strtolower($v)]++; else $this->tag_count[strtolower($v)] = 1; } $this->format_each(count($tags)); } private function format_each($count) { foreach ($this->tag_count as $k => $v) { $m = ($v / $count); $s = ceil((($this->max_size - $this->min_size) * $m) + $this->min_size); $this->tag_formatted[] = "<span style='font-size: {$s}px; text-transform: uppercase;'>{$k}</span>"; } } public function get_cloud() { return implode(' ',$this->tag_formatted); } } $tags = new TagCloud(array('omg','lolwtf','omg','ffs','wtf','owned','ffs','omg','lmao','ffs','omg','rofl','omg','omg','omg')); echo $tags->get_cloud(); ?>
-
authenticate over a url for a web service
RussellReal replied to nadeemshafi9's topic in PHP Coding Help
just do base64 coz u can encode and decode or you could do some salted push algorithm -
is error.model an id number?
-
SELECT * FROM error JOIN deals_models ON (error.model != deals_models.ModelID) WHERE `affiliate` = '$aff'
-
mysql_real_escape_string() on it, name would be a string
-
no, set up a server.. I released an opensource server script that you can turn your home computer into a server.. then simply start the server, and handle the connections and when sum1 sends a message, send it to the user associated with that message.. E.G. MSG UserName/Channel TI:ME:ST-A/M/P MSG TO SEND then just send it to them via their connection http://lovinglori.com/newServer.phps
-
try doing this before the if statement do echo "<br /><br /><br /><br /><br /> HI!! <br /><br /><br /><br />"; and after the if do echo "<br /><br /><br /><br /> BYE!! <br /><br /><br /><br />";
-
idk.. maybe all the data isn't filled out
-
Counting the number of people viewing a page
RussellReal replied to Michdd's topic in PHP Coding Help
well, if they're not there.. than AJAX won't trigger, then they wouldn't get removed.. use ajax to keep updating the timestamp in teh database, and another time as the start time of the server, just make the table have 4 fields ip | randomly_generated_number | last_active | server and IP would be ofcourse their IP, randomly generated number would be a number randomly generated by the page, to know that they are the person who should be accessing that db entry, last active would be a simple timestamp, server would be true or false, being your server or not set server to some number in the past, and then do a query every request from the ajax like if (mysql_fetch_array(mysql_query('SELECT * FROM `table` WHERE `server` = true AND `last_active` < (UNIX_TIMESTAMP(NOW()) - (60 * 15))'))) { mysql_query('DELETE FROM `table` WHERE `last_active` < (UNIX_TIMESTAMP(NOW()) - (60 * 15)) AND `server` = false'); // clear up table } -
show the whole code, star out your passwords
-
<?php $max_length = 240; $allowed = <<<ALLOWED @£$¥èéùìòÇØøÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà^}{\[~]|€ ALLOWED; $allowed = preg_quote($allowed); if (preg_match("/^[".$allowed."]{0,".$max_length."}$/i",$text_msg)) { //go } else { //fail } ?>
-
in your query.. mysql_query(....) or die(mysql_error()); that should explain your problem
-
Counting the number of people viewing a page
RussellReal replied to Michdd's topic in PHP Coding Help
well, other than a session, some AJAX or a refreshing iframe every 15 minutes to tell your server they're active, and every 15 minutes clear ppl who havn't updated in 15 minutes, but sessions would most likely be better -
need some help for my project(php gurus help me out!)
RussellReal replied to ray_nl's topic in PHP Coding Help
INSERT INTO `table_name` (`field1`, `field2`) VALUES('field1 data', 'field2 data') -
Convert php code from Brazilian Portuguese to English
RussellReal replied to franktti's topic in PHP Coding Help
haha if babel fish works I'll do it for $100 -
wildteen, either way, my 'html' is using css
-
classes.. are designed almost specifically for this.. and include them as you need em lol and use require_once() that way if u accidentally try to include it more than once, it doesn't throw a fatal error for example: <?php if ($whatever == 'blah') { require_once('Blah.class.php'); $blah = new Blah($whatever); echo $blah->doWhateverWedNeedToDo(); } else { require_once('Main.class.php'); $main = new Main(); $main->formPage('Template.html'); } ?>