-
Posts
630 -
Joined
-
Last visited
Never
Everything posted by BillyBoB
-
[SOLVED] Preventing simultaneous updates in MySQL
BillyBoB replied to longtone's topic in PHP Coding Help
include a timestamp with the database entrant and then if it becomes a problem and they think they won just tell them that they were milliseconds away and to deal with the loss -
Calendar.php around line 226
-
ill just put the if commands in instead I am building a SerialKey Identifier thats why i want it to be confusing to decompile i think im going to have to obfuscate it with something.
-
Essentially all I'm trying to do is find out if the varible "$o027asdf04qvnola" is equal to "" if it is true then I would return the string "lkas45n87x02xhy"
-
function getMonthHTML($m, $y, $showYear = 1) { $s = ""; $a = $this->adjustDate($m, $y); $month = $a[0]; $year = $a[1]; $daysInMonth = $this->getDaysInMonth($month, $year); $date = getdate(mktime(12, 0, 0, $month, 1, $year)); $first = $date["wday"]; $monthName = $this->monthNames[$month - 1]; $prev = $this->adjustDate($month - 1, $year); $next = $this->adjustDate($month + 1, $year); if ($showYear == 1) { $prevMonth = $this->getCalendarLink($prev[0], $prev[1]); $nextMonth = $this->getCalendarLink($next[0], $next[1]); } else { $prevMonth = ""; $nextMonth = ""; } $header = $monthName . (($showYear > 0) ? " " . $year : ""); $s .= "<table class=\"calendar\">\n"; $s .= "<tr>\n"; $s .= "<td align=\"center\" valign=\"top\">" . (($prevMonth == "") ? " " : "<a href=\"$prevMonth\"><<</a>") . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\" colspan=\"5\">$header</td>\n"; $s .= "<td align=\"center\" valign=\"top\">" . (($nextMonth == "") ? " " : "<a href=\"$nextMonth\">>></a>") . "</td>\n"; $s .= "</tr>\n"; $s .= "<tr>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+1)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+2)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+3)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+4)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+5)%7] . "</td>\n"; $s .= "<td align=\"center\" valign=\"top\" class=\"calendarHeader\">" . $this->dayNames[($this->startDay+6)%7] . "</td>\n"; $s .= "</tr>\n"; // We need to work out what date to start at so that the first appears in the correct column $d = $this->startDay + 1 - $first; while ($d > 1) { $d -= 7; } // Make sure we know when today is, so that we can use a different CSS style $today = getdate(time()); while ($d <= $daysInMonth) { $s .= "<tr>\n"; for ($i = 0; $i < 7; $i++) { $class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar"; $s .= "<td class=\"$class\" align=\"right\" valign=\"top\">"; if ($d > 0 && $d <= $daysInMonth) { $link = $this->getDateLink($d, $month, $year); $s .= (($link == "") ? $d : "<a href=\"$link\">$d</a>"); } else { $s .= " "; } $s .= "</td>\n"; $d++; } $s .= "</tr>\n"; } $s .= "</table>\n"; return $s; } Input CSS to the coding above in your table's TDs and TRs depends what you want them to do. Inside: for ($i = 0; $i < 7; $i++) { $class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar"; $s .= "<td class=\"$class\" align=\"right\" valign=\"top\">"; if ($d > 0 && $d <= $daysInMonth) { $link = $this->getDateLink($d, $month, $year); $s .= (($link == "") ? $d : "<a href=\"$link\">$d</a>"); } else { $s .= " "; } $s .= "</td>\n"; $d++; } The link part is where you would want to put the thumbnail.
-
I get: Parse error: syntax error, unexpected T_RETURN in /var/www/html/test.php on line 15 Code: $o027asdf04qvnola==""?return"lkas45n87x02xhy"; I just started using the short code for if's and so on. Thats probably where my error is can anyone help me out?
-
What do you mean it doesnt show the right amount could you give us an example?
-
<input type="text" name="name" value="<?php echo $username; ?>" disabled /> hope that helps
-
Any ideas out there?
-
I dont know how much faster this is but this is the way i would do it. <?php echo(" <form method=\"POST\"> "); $dir = './pics/'; $handle = opendir($dir); while (($file = readdir($handle)) !== false) { if ( !in_array($file, array('.', '..') ) ) { $file_list[] = basename($file, '.jpg'); } } closedir($handle); asort($file_list); echo (" <center><form method=\"POST\">Select:<select name=\"pic\"> "); foreach($file_list as $key => $value){ echo (" <option>$value</option> "); } echo(" </select> <input type=\"submit\" name=\"submit\" value=\"View Pic\" /> </form></center> "); ?> Edit as needed.
-
Here is my update. Same URLS as above. I have the textboxes filling but when i set the contentpaths equal to the pic1.text it comes up with this error Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic5' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic4' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic3' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic2' Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic1' which means it is really not finding the string that lies within it is just taking the actually text in the code and using it. Code: loadVariables("http://dreamshowstudios.net/development/DSS/slider.php", this, "GET"); if(_root.pic1.text ne "") { _root.Ctrls.Pic1.contentPath = _root.pic1.text; _root.Ctrls.Pic2.contentPath = _root.pic2.text; _root.Ctrls.Pic3.contentPath = _root.pic3.text; _root.Ctrls.Pic4.contentPath = _root.pic4.text; _root.Ctrls.Pic5.contentPath = _root.pic5.text; }
-
how can i compaire a string in LIKE analogy of MySQL
BillyBoB replied to snk's topic in PHP Coding Help
RegEx. Stands for Regular Expressions. http://www.google.com/search?channel=s&hl=en&q=RegEx+PHP&btnG=Google+Search -
No problem Glad to be of some help.
-
Since dividing a negative one by two is the same as dividing a positive one by two with the exception of the negative. Just see it if it positive or negative. if($num_haros<0) { $comment = "negative"; $num_haros = $num_haros * -1; } Then use the info to do the for statement and use the $comment to see if it is a negative or not.
-
Sorry bout the mix-up. The flash is on my mainpage http://dreamshowstudios.net/development/DSS/ the link i gave you was just to the php file. i have all the textboxes set to the varible i want to come up. how do i set the contentpath to the text in the textboxes.
-
can i see some of the coding maybe farther up like where you set the $num_haros
-
Ok I'm making some progress. I have pic1 coming in and going into the box under ContentLoader1. Im trying to get that text to be the contentpath in the ContentLoader. _root.Pic1.contentPath = _root.pic1.text; But its not working. The php file is at http://dreamshowstudios.net/development/DSS/slider.php
-
The problem is that i cant retrieve the varible named pic1 from my php and use it to set a contentloader in flash.
-
try using CSS not php. the CSS for center middle is style="text-align: center; vertical-align: top;" This goes into a tag like so(not only this tag it works for any block tag.) <p style="text-align: center; vertical-align: top;">
-
I'm working on my site http://dreamshowstudios.net and I am trying to make a recent projects flash to display the recent projects with a thumbnail. I have the flash worked out everything is ready I just need a little advice or a pointer of what I'm doing wrong. Here is what I have now: PHP: <?php require_once("config.php"); if($_GET['num']) { $i = 0; $query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT '$_GET[num]',5"); while($result = mysql_fetch_array($query)) { $i++; $string .= "pic" . $i . "=" . $result['image']; if($i>0 or $i<5) { $string .= "&"; } } print $string; }else{ $i = 0; $query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT 5") or die(mysql_error()); while($result = mysql_fetch_array($query)) { $i++; $string .= "pic" . $i . "=" . $result['image']; if($i>0 or $i<5) { $string .= "&"; } } print $string; } ?> Flash: The flash can be seen at my development folder not at the main site. http://dreamshowstudios.net/development/DSS ActionScript: loadVariables("slider.php", ""); _root.text1.text = pic1; if (pic1 ne undefined) { Pic1.contentPath = "portfolio/" & pic1; } The _root.text1.text = pic1 is for debugging.
-
[SOLVED] mysql_fetch_array throwing up error
BillyBoB replied to chiprivers's topic in PHP Coding Help
Did you copy this code? because you have a spelling error. <?php $query = "blah blah blah"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { // do this stuff } ?> The $result was spelled $reault -
try: <?php ob_start(); ?> add this to the top of any php page with cookies in it.
-
Aquarium filtered 9 words in 0.1 seconds and found 4 bad words. Stats: 87 words per second, 44.4% bad words. Filtered Text: Nigger **** Wetback **** **** ****** Honky Spic Chink
-
how bout giving us some code to debug??? we arnt magical...