-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Trying to understand functions & inheritance
MadTechie replied to WilliamNz's topic in PHP Coding Help
almost class soccer { function roffle_lol($tevez) { $this->$tevez; return $tevez; } } $lol = "TEVEZZZ!"; $soc = new soccer; $result = $soc->roffle_lol($lol) echo($result); -
in addition to Barand corrections i think its important to point out that for a counter (like a site counter) your need to store the data somewhere ie file/database as your starting i would suggest a file heres a very basic read and write (i'll leave you to workout how to join them up) fwrite fread
-
$user['auth'] wasn't passed to the function try function displayLogin($user) if that makes sense
-
i think you mean addslashes or htmlspecialchars if not try them
-
2 options spring to mind strpos & substr or RegEx (ie preg_grep) Edit: fixed preg-grep link
-
[SOLVED] what's better, 2 tables, or one large (in this situation)
MadTechie replied to dj-kenpo's topic in PHP Coding Help
LOL, ok to sum up, it depends on the scale of the database -
local ip, or whatever ip is unique to every computer, iunno
MadTechie replied to gsquare567's topic in PHP Coding Help
your IP check is ok or can't be done side 1 try \t side 2 try strlen("hello"); -
[SOLVED] what's better, 2 tables, or one large (in this situation)
MadTechie replied to dj-kenpo's topic in PHP Coding Help
you might want to read up on indexing In general, when you want to make a slow SELECT ... WHERE query faster, the first thing to check is whether you can add an index. All references between different tables should usually be done with indexes. -
no worries, but clicking solved would of been nice....
-
LOL click solved if it is working happens to the best of us
-
local ip, or whatever ip is unique to every computer, iunno
MadTechie replied to gsquare567's topic in PHP Coding Help
what your looking for Doesn't exist, the closest your get is the MAC address (serial number of the network card) but they can be spoofed! -
i wanted to see if the data was being posted as <h5>Bungie Weekly Update </h5> or <h5>Bungie Weekly Update </h5> addslashes shouldn't do that OK combo time in addition to what you have. use html_entity_decode($fromDB); this WILL translate to html
-
remove //Checking required fields foreach($req as $checkq) { if (empty($_POST[$checkq])) error_handler('<h2>Error</h2>' . $error_required); } //endforeach as its doesn't seam to be in use anyways
-
can you do the following and post the results please echo "<pre>"; print_r($_POST);
-
[SOLVED] what's better, 2 tables, or one large (in this situation)
MadTechie replied to dj-kenpo's topic in PHP Coding Help
as i assumed you had blogs and you don't i have to move to Andy B side (if the tables are almost exact ie both alway have the same number of records etc and one isn't being used for a massive data hold) -
Hummm it should reverse the effect!! try using addslashes & stripslashes //to DB $content = addslashes ($_POST['news']); //from DB stripslashes($_POST['news']) = $content;
-
other options to look at are addslashes & stripslashes
-
when inserting remember the quotes and slashes can messs things up, myphpadmin fixes a few of these to reverse use $_POST['news'] = htmlspecialchars_decode($content, ENT_QUOTES); well maybe not $_POST['news'] = lol
-
try $content = htmlspecialchars($_POST['news'], ENT_QUOTES);
-
basically neel_basu is saying do it outside the mysql request,
-
looks ok, have you tried it ?
-
file_get_contents() using cookie information
MadTechie replied to springo's topic in PHP Coding Help
whats wrong with the cookie creation ? nm.. i give! -
INSERT = NEW UPDATE = erm.. well UPDATE and existing one and the WHERE needs to have operators!! what are you trying to do ? WHERE datestamp='2007-04-28', ID='vtc2av' this datestamp='2007-04-28' AND ID='vtc2av' or datestamp='2007-04-28' OR ID='vtc2av' what!!!
-
file_get_contents() using cookie information
MadTechie replied to springo's topic in PHP Coding Help
OK but your question was so Step #1 set the cookie, Step #2 use file_get_contents() "to parsing a dynamic page which requires cookie info to display properly" as its on another domain, that domain will have to create the cookie, -
so something like this <?php // How many images to span across the page before they go on to the next $maxItemsPerRow = 5; $StartRow = 0; $rating = mysql_query("SELECT * FROM ratings WHERE which_user = '{$profile_info['username']}' ORDER BY total_votes DESC LIMIT $StartRow,$maxItemsPerRow") or die(mysql_error()); if(mysql_num_rows($rating) > 0) //create a loop, because there are rows in the DB ?> <table border="0" cellpadding="1" cellspacing="0"> <tr> // Insert row break </tr><tr> <?php while($row = mysql_fetch_assoc($rating)) { echo "<td style=\"font-size: 7pt; font-family:Verdana, Arial, Helvetica, sans-serif; \"> <a href=\"javascript:poptastic('view_art.php?member_id=$row[which_id]');\"><img src=\"$row[tpath]\" /></a> </td>"; } ?>