PHP - Border Appears On Nested Ul Instead Of Parent Ul?
Would you know why the bottom border appears on the nested ul's (line 36) instead of the parent ul (line 10)?
THANKS!
* { margin: 0; padding: 0; } body { background: black; } nav ul { list-style: none; border-bottom: 1px solid #404040; } nav li { position: relative; float: left; /* Width for About, Graphic Design & Contact */ width: 15%; } /* Width for Mobile Apps & Web */ nav li:nth-of-type(3), nav li:nth-of-type(4) { width: 27.5%; } nav a { color: #404040; font-size: 1.5em; font-weight: bold; text-decoration: none; display: block; } nav ul ul { /*display: none;*/ position: absolute; z-index: 99; } nav li li { width: inherit; float: none; } nav li li a { font-size: 1.25em; } <!DOCTYPE HTML> <html> <head> <title>PowerON Technologies - San Diego-Based Graphic Design, Mobile App & Web Development Firm</title> <!-- HTML5Shiv helps older browsers display HTML 5 elements. --> <!--[if lt IE9]> <script src="_js/html5shiv.js"></script> <![endif]--> <!-- /HTML5Shiv --> <!-- CSS --> <!-- Normalize.css makes tags look the same in all browsers --> <link href="_css/normalize.css" type="text/css" rel="stylesheet"> <link href="_css/styles.css" type="text/css" rel="stylesheet"> <!-- /CSS --> <!-- JavaScript --> <script src="_js/jQuery.js" type="text/javascript"></script> <script src="_js/scripts.js" type="text/javascript"></script> <!-- /JavaScript --> </head> <body> <!-- NAV BAR --> <nav> <ul> <li><a href="#">About</a></li> <li> <a href="#">Graphics</a> <ul> <li><a href="#">SAIC</a></li> <li><a href="#">YouthBuild</a></li> </ul> </li> <li> <a href="#">Mobile Apps</a> <ul> <li><a href="#">Big Brothers Big Sisters</a></li> <li><a href="#">YMCA</a></li> </ul> </li> <li> <a href="#">Web</a> <ul> <li><a href="#">Challenged Athletes Foundation</a></li> <li><a href="#">Make-A-Wish Foundation</a></li> <li><a href="#">Turning The Hearts Center</a></li> </ul> </li> <li><a href="#">Contact</a></li> </ul> </nav> <!-- /NAV BAR --> </body> </html>Attached Files index.zip 3.72KB 0 downloads Similar TutorialsThis is a long post, but most of it is backup information, and I hope I don't scare you away.
I created a self signed signature as follows: # Create the key openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -aes-128-cbc -out key.pem # Create the certificate signing request openssl req -new -key key.pem -sha256 -days 365 -out csr.pem # Remove pass-phrase from the key cp key.pem key.pem.tmp openssl rsa -in key.pem.tmp -out key.pem rm -f key.pem.tmp # Sign the certificate. openssl x509 -req -in csr.pem -signkey key.pem -sha256 -days 365 -out crt.pem cp key.pem /etc/pki/tls/private/key.pem cp csr.pem /etc/pki/tls/private/csr.pem cp crt.pem /etc/pki/tls/certs/crt.pem rm -f key.pem rm -f csr.pem rm -f crt.pemI've since gotten a Class 2 certificate from StartSSL so I will not need the above created crt.pem. I used the content in csr.pem above, and saved it as /etc/pki/tls/certs/startssl.crt. I set it up using example.com as the primary domain and *.example.com as the secondary domain. /etc/httpd/conf.d/ssl.conf includes more, but for discussion purposes, includes the following: LoadModule ssl_module modules/mod_ssl.so Listen 443 <VirtualHost _default_:443> SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateKeyFile /etc/pki/tls/private/key.pem #SSLCertificateFile /etc/pki/tls/certs/crt.pem SSLCertificateFile /etc/pki/tls/certs/startssl.crt SSLCertificateChainFile /etc/pki/tls/certs/sub.class2.server.ca.pem SSLCACertificateFile /etc/pki/tls/certs/startssl.crt </VirtualHost>/etc/httpd/conf/httpd.conf includes the following: ... ServerName example.com ... NameVirtualHost *:443 <VirtualHost *:443> SSLEngine on SSLCipherSuite SSLv3:TLSv1:+HIGH:!SSLv2:!MD5:!MEDIUM:!LOW:!EXP:!ADH:!eNULL:!aNULL #SSLCertificateFile /etc/pki/tls/certs/crt.pem SSLCertificateFile /etc/pki/tls/certs/startssl.crt SSLCACertificateFile /etc/pki/tls/certs/startssl.crt SSLCertificateKeyFile /etc/pki/tls/private/key.pem SSLCertificateChainFile /etc/pki/tls/certs/sub.class2.server.ca.pem ServerName example.com ServerAlias *.example.com DocumentRoot /var/www/html </VirtualHost>When I restart httpd, I get the following: [root@vps tls]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] [root@vps tls]# tail /var/log/httpd/error_log [Thu Jan 22 12:25:24 2015] [notice] caught SIGTERM, shutting down [Thu Jan 22 12:25:24 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Jan 22 12:25:24 2015] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366) [Thu Jan 22 12:25:24 2015] [notice] Digest: generating secret for digest authentication ... [Thu Jan 22 12:25:24 2015] [notice] Digest: done [Thu Jan 22 12:25:24 2015] [warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366) [Thu Jan 22 12:25:24 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.5.18 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips configured -- resuming normal operations [root@vps tls]# tail /var/log/httpd/ssl_error_log [Thu Jan 22 12:25:24 2015] [warn] RSA server certificate wildcard CommonName (CN) `*.example.com' does NOT match server name!? [Thu Jan 22 12:25:24 2015] [warn] RSA server certificate wildcard CommonName (CN) `*.example.com' does NOT match server name!? [root@vps tls]#When I access the site, the browser states: This Connection is Untrusted Questions... Does not the actual VirtualHost extend the _default_ VirtualHost? Why is SSLEngine on required in both (seems to have error when I remove it in the actual VirtualHost)? Should the keys be in the _default_ VirtualHost, or the actual one, or both? Seems like some of the directives needs to be in both which surprised me as I thought one was extended off the other. When is SSLCertificateFile and SSLCACertificateFile required? Why the difference? Why the errors and untrusted connection? Thank you When I run this code every time it is run in a firefox browser it seems to run twice and it records 2 entires, I have tried different machines and also different versions of FF but each time I run this. in my log file I see the following Quote Time: 27th February 2012 10:55:09 am IP Address: 173.195.xxx.xxx Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Time: 27th February 2012 10:55:10 am IP Address: 173.195.xxx.xxx Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 In Chrome and IE I just get a single entry in my log.html file Code: [Select] <?php // Create a new image instance $im = imagecreatetruecolor(70, 20); // Make the background white imagefilledrectangle($im, 0, 0, 70, 20, 0xFFFFFF); $font = imageloadfont('arial.gdf'); // Draw a text string on the image imagestring($im, $font, 0, 0, 'Hello World', 0x000000); // Output the image to browser header('Content-Type: image/gif'); imagegif($im); imagedestroy($im); // Get server variables $address = $_SERVER['REMOTE_ADDR']; $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $browser = $_SERVER['HTTP_USER_AGENT']; // Do not log the full IP address replace the last 2 octets $address = preg_replace('/\.\d+\.\d+$/', '.xxx.xxx', $address); //Set time zone and date format date_default_timezone_set('Australia/Sydney'); $accessTime = date("jS F Y g:i:s a"); //Open log file $file = fopen("log.html",'a'); //write collected data to file fwrite($file, "<b>Time:</b> $accessTime<br />"); if( $address != null) fwrite($file,"<b>IP Address:</b> $address<br />"); if($referer != null) fwrite($file,"<b>Referer:<b> $referer<br />"); fwrite($file,"<b>Browser:</b> $browser<hr>"); // save file and close fclose($file); ?> Hello dears, Let say we have the following form code Code: [Select] <form action="post" method="post" name="form"> Your Name : <input name="name" type="text" id="name"> <input type="submit" name="Submit" value="Submit"> </form> what if i want it to be viewed as image Why ! in fact i've text-area where i will put some HTML codes and i want the output of that code appears normally as web-browser view but as image , means no way to click on it or operate just appears as image I do not know if it possible or not but i wonder it it can be and here is example for exactly how this forms i wants to appears output of the html codes appears as image so any method any help any function or class can do like this ?! Thanks Hint : someone told me this way Put and transparent block element over it (position: absolute and so on) but i'm not sure if it right or not and how to do it , can anyone point to me simple example ! I'm working on a pair of scripts that (among other tasks) download a file to the user's browser. It's not working right, and I'm having trouble figuring out why. The overall design is: the first script (I'll call it one.php) contains a form which displays a list of radio buttons representing actions that the site can perform. The user clicks a radio button, then a "submit" button. This loads two.php, which determines what action the the user selected, performs the action, and loads a page that contains another form. This form has a couple of "submit" buttons; one reloads one.php, and the other goes elsewhere. Everything works right except when the user selects the "download a file" option. In that case two.php downloads the file (and that part works perfectly), then -- nothing. The page defined in two.php never appears. The browser just sits displaying the page from one.php as it was when the submit button was clicked. I played with the code and found that if I comment out all of the download headers, so that the browser gets the raw contents of the downloaded file followed by an HTML page, the browser does just what I'd expect: it displays the file (represented as a stream of semi-binary garbage), followed by an HTML page. Something in the download headers is upsetting it... but I can't figure out what. Here is the code that sends the headers: Code: [Select] header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($file) ); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file) ); if (ob_get_length() > 0) { ob_clean(); } flush(); readfile($file); flush(); Following that, the script includes a file that contains another block of PHP code, then the <!DOCTYPE> tag, with no intervening characters outside the PHP. (BTW, the PHP block contains nothing but comments!) Can anyone suggest what's going wrong here? I have php code that searched for results of properties from my MYSQL database, but how can i position it and style it with font and colours etc? any help will be appreciated,thanks. In the php web script, when a user is redirected to faq, for example, the web script displays website.net/faqfolder in the web browser field Can it be modified to just display website.net/faq? If so, how? I have been working with PHP & CSS for a few months, and want to develop a drop-down menu that appears when mousing over a list item. The menu would display the contents of a MySQL query. What is the easiest way to do this? Could you provide sample code? And, is JavaSript absolutely necessary? Thanks. I've added this code (below) to a file called uploader.php (attached).
When I simply open the corresponding html page, I see "Invalid upload file" in the top left corner of the page. When I remove this code from uploader.php the "Invalid upload file" disappears. Any ideas on how to resolve this will be appreciated.
$allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); // in case user named file ".JPG" etc.!!! if ( $_FILES["file"]["size"] < 200000 && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $length = 20; $randomString = substr(str_shuffle(md5(time())),0,$length); $newfilename = $randomString . "." . $extension; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename); $file_location = '<a href="http://www.-----.com/upload/' . $newfilename . '">' . $newfilename . '</a>'; } } else { echo "Invalid upload file"; } $description = $description . " \n " . $newfilename; there is no error that is actually stated when you use this code, but the page that this code appears on goes blank for some reason. I would like to know why the page is blank when this code is uploaded to the server. Code: [Select] <? $NOW = date("YmdHis",mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y"))); ?> <script language="Javascript" type="text/javascript"> function window_open(pagina,titulo,ancho,largo,x,y){ var Ventana= 'toolbar=0,location=0,directories=0,scrollbars=1,screenX='+x+',screenY='+y+',status=0,menubar=0,resizable=0,width='+ancho+',height='+largo; open(pagina,titulo,Ventana); } function makevisible(cur,which){ strength=(which==0)? 8.5 : 0.85; if (cur.style.MozOpacity) { cur.style.MozOpacity=strength; } else if (cur.filters) { cur.filters.alpha.opacity=strength*100; } } </script> <script language="JavaScript" type="text/javascript"> TargetFromte = "05/25/2008 9:00 AM"; BackColor = ""; ForeColor = "#0000CC; font-family: Arial Bold; font-size:38px"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%%d %%H%%h %%M%%m %%S%%s"; FinishMessage1 = "<?=$MSG_31_0023;?>"; FinishMessage2 = "<?=$MSG_31_0024;?>"; </script> <div> <div> <div> <table width="99%"> <tr> <td><? echo $TPL_title_value ?></td> <td align=center> <font style="font-size:14px; font-weight:bold;"> <? if($auction_type == "1" && $my_closed=="0"){ echo $MSG_WINNER; }elseif(intval($auction_type)>1 && $is_auction_finished === false){ echo $MSG_WINNER; } ?> </font> </td> <td align="right"><? echo $MSG_113 ?>: <? echo $TPL_id_value ?></td> </tr> </table> </div> <div style="margin-left:15px;margin-right:15px;"> <table width=99%> <tr valign=middle style="height:15px;" > <td align=left nowrap> <?=$HOW_MANY_MSG?> </td> <td width="100%"></td> <td nowrap> <? #// If user is not logged don-t show view history if(isset($_SESSION["BPLowbidAuction_LOGGED_IN"])) { if($auction_type == "1"){ if($TPL_BIDS_value) echo $TPL_BIDS_value." | "; }else if($auction_type == "2"){ if($TPL_BIDS_value) echo $TPL_BIDS_value." | "; } } ?> </td> <td nowrap> <a href="<?=$SETTINGS['siteurl']?>friend.php?id=<?=$_GET['id'];?>"> <?=$MSG_106 ?> </a> </td> <? if($_SESSION["BPLowbidAuction_LOGGED_IN"]) { ?> <td nowrap> | <a href="<?=$SETTINGS['siteurl']?>item_watch.php?add=<?=$TPL_id_value?>"> <?=$MSG_5202?> </a> </td> <? } else { ?> <td nowrap> | <a href="<?=$SETTINGS['siteurl']?>user_login.php?"> Login </a></td> <? } if($auction_type == "1" && $my_closed=="1") { ?> <td nowrap style="height:15px;" valign=middle> <a style="height:15px;" href="<?=$SETTINGS['siteurl']?>view_bid_history.php?id=<?=$TPL_id_value?>"> <img alt="Bid History" src="themes/default/img/storico.png" width=110 height=15 border=0> </a></td> <? }elseif(intval($auction_type)>1 && $is_auction_finished) { ?> <td nowrap style="height:15px;" valign=middle> <a style="height:15px;" href="<?=$SETTINGS['siteurl']?>view_bid_history.php?id=<?=$TPL_id_value?>"> <img alt="Bid History" src="themes/default/img/storico.png" width=110 height=15> </a></td> <? } ?> </tr> </table> </div> <br> <div> <table width="100%"> <tr> <td valign="top"> <div style="margin-left:10px;"> <table id="itempagetable" class='table1'> <tr> <td height="100%" colspan="2" valign="top" style="padding-left:10px; padding-right:10px;"> <table width="100%" cellpadding="5"> <tr> <td width="10%" valign="top"> <table> <tr> <td align='center' nowrap> <img src='<?=$SETTINGS['siteurl'].$pict_url;?>' height='100px'> </td> </tr> </table> </td> <td width="60%" valign="top"> <table width="100%" align="center" valign="top"> <tr> <td align="left" valign="top"> <? echo $MSG_611 ?> <font color="#ff3300"><b> <? echo $TPL_nr ?> </b> </font> <? echo $MSG_612 ?> <br /> <? // High bidder ?> <table width="100%" height='70px' cellpadding="1" > <!-- auction type --> <!-- higher bidder --> <? if ( $high_bidder_id ) { ?> <tr> <td width='50%' style="leftpan" valign="top"> <?=$MSG_117?>: </td> <td> <?=$TPL_hight_bidder_id?> <?=$TPL_bidder_rate?> <?=$TPL_bidder_rate_radio?> <br><?=$MSG_25_0200.$TPL_bidder_feedbacks?> <br><a href="<?=$SETTINGS['siteurl']?>active_auctions.php?user_id=<? echo $userid?>"><? echo $MSG_213 ?></a> <? if($BIDDERHASABOUTME) { echo "<a href=".$SETTINGS['siteurl']."useraboutme.php?id=$BIDDERHASABOUTME><IMG ALIGN=MIDDLE SRC=".$SETTINGS['siteurl']."images/aboutme.gif BORDER=0></a>"; } ?> <?=$TPL_bidder_trusted?> </td> </tr> <? } ?> <!-- ** Number of bids --> <? if($ITEM['bn_only']=='n'){ ?> <tr> <td width="50%" align="left"><?=$MSG_119 ?>: </td> <td align="left"><?=$TPL_num_bids_value ?> <? if($TPL_BIDS_value) echo "( ".$TPL_BIDS_value." )"; ?> </td> </tr> <!-- ** Starting bid --> <? } ?> <!-- ** Buy now price --> <!-- ** If auction is closed --> <tr> <td width="50%" align="left"><? echo (($item_value != "") ? $MSG_708.": " : ""); ?></td> <td align="left"><?= print_money($item_value) ?></td> </tr> <tr> <td width="50%" align="left"><? echo (($bid_value != "") ? $MSG_33_0011.": " : ""); ?></td> <td align="left"><?=print_money($bid_value) ?></td> </tr> <?php if($auction_type == '1'){ ?> <?php }else if($auction_type == '2'){ ?> <tr> <td width="50%" colspan="2" align="left"> <input type='hidden' id='el_time_0' value='<?=$date_created;?>' /> <input type='hidden' id='el_type_0' value='1' /> <input type='hidden' id='el_sec_0' value='<?=$remained_seconds;?>' /> <span id='el_0' style='font-family:arial;font-size:16px; font-weight:bold; color:#ef0000;'>--|--|--</span> </td> </tr> <?php } ?> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </div> <br /> <table align=center width="97%" height="219" class="gray_img"> <tr> <td height="100%" colspan="2" valign="top" style="padding:0px 13px 0px 13px;"> <h3><? echo $MSG_109 ?></h3> <? echo $description ?> </td> </tr> </table> <a name="image"></a> <div class="table2" style="text-align:center;padding-left:20px;"> <? echo $TPL_pict_url ?> </div> <? if($TPL_show_gallery != "") { ?> <!-- Pictures Gallery --> <div class="tableContent2"> <div > <a name="gallery"></a><? echo $MSG_663 ?> </div> <div class="table2" style="text-align:center"> <? echo $TPL_show_gallery ?> </div> </div> <? } ?> <!-- ==================================================== Questions & Answers ======================================================--> <? if(file_exists('./includes/viewpublicboard.inc.php')){ ?> <a name="qa"></a> <div class="tableContent2"> <div > <a name="gallery"></a><? echo $MSG_926 ?> </div> <div class="tableContent2"> <? include('./includes/viewpublicboard.inc.php'); ?> </div> </div> <? } ?> <br> </td> <td width="2%"> </td> <td width=37% valign="top" align="left"> <table width="340px;" class='table1'> <tr> <td height="100%" colspan="2" valign="top" style="padding-left:10px; padding-right:10px;"> <table width="100%" > <? //if($_SESSION["BPLowbidAuction_LOGGED_IN"]) { echo "<tr><td align='left'>"; if(($auction_type == "1") || ($auction_type == "2")){ if($AuctionIsClosed == false){ drawFormRevolution("play", $BIDFILE); }else{ echo " ".$MSG_31_0023; // was already closed } } //} echo "</td></tr>"; ?> </table> <? //if($TPL_auctions_list_value != ""){ ?> <br><br><br><br> <? //} ?> </td> </tr> </table> <br /> <table width="340px;" class='table1'> <tr> <td height="100%" colspan="2" valign="top" style="padding-left:10px; padding-right:10px;"> <table width=100%> <tr> <td width=100% valign=top> <!--Bid History--> <? if($TPL_auctions_list_value != ""){ ?> <TABLE WIDTH=100% HEIGHT=30> <TR valign=top> <TD WIDTH=30 BGCOLOR="#0000FF"> </TD> <TD WIDTH=80 style="padding-left:3px;" ><? echo $MSG_33_0012;?></TD> <TD WIDTH=30 BGCOLOR="#ffff00"> </TD> <TD WIDTH=80 style="padding-left:3px;"><? echo $MSG_33_0013;?></TD> <TD WIDTH=30 BGCOLOR="#cd0000"> </TD> <TD WIDTH=80 style="padding-left:3px;"><? echo $MSG_33_0014;?></TD> </TR> </TABLE> <? } ?> <table width="200px" cellpadding=4 cellspacing=1 align=center> <tr class=''> <td align=CENTER><?=$MSG_639?></td> </tr> <? if($TPL_auctions_list_value != ""){ ?> <? print $TPL_auctions_list_value; ?> <? } ?> </table> <!-- ================================================--> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <br> </div> </div> </div> <? $total_elements = 1; ?> <script language="JavaScript"> function calcage(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero && s.length < 2) s = "0" + s; return "<b>" + s + "</b>"; } function CountBack() { <? for($i=0; $i<$total_elements; $i++){ echo "myTimeArray[".$i."] = myTimeArray[".$i."] + CountStepper;"; } for($i=0; $i<$total_elements; $i++){ echo "secs = myTimeArray[".$i."];"; echo "DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,1000000));"; echo "DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));"; echo "DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));"; echo "DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));"; echo "if(secs < 0){ if(document.getElementById('el_type_".$i."').value == '1'){ document.getElementById('el_".$i."').innerHTML = FinishMessage1; }else{ document.getElementById('el_".$i."').innerHTML = FinishMessage2;"; //if(!$TPL_is_auction_started[$i]){ echo "setTimeout(\"document.location.href = 'index.php';\",5000);"; } echo " }"; echo "}else{"; echo " document.getElementById('el_".$i."').innerHTML = DisplayStr;"; echo "}"; } ?> if (CountActive) setTimeout("CountBack()", SetTimeOutPeriod); } function putspan(backcolor, forecolor, id) { document.write("<span id='"+ id +"' style='background-color:" + backcolor + "; color:" + forecolor + "'></span>"); } if (typeof(BackColor)=="undefined") BackColor = "white"; if (typeof(ForeColor)=="undefined") ForeColor= "black"; if (typeof(TargetDate)=="undefined") TargetDate = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat)=="undefined") DisplayFormat = "%%D%%d, %%H%%h, %%M%%m, %%S%%s."; if (typeof(CountActive)=="undefined") CountActive = true; if (typeof(FinishMessage)=="undefined") FinishMessage = ""; if (typeof(CountStepper)!="number") CountStepper = -1; if (typeof(LeadingZero)=="undefined") LeadingZero = true; CountStepper = Math.ceil(CountStepper); if (CountStepper == 0) CountActive = false; var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990; var myTimeArray = new Array(); <?php if($auction_type == '2'){ ?> <? for($i=0; $i<$total_elements; $i++){ ?> ddiff=document.getElementById('el_sec_'+<?=$i;?>).value; //myTimeArray[<?=$i;?>] = Math.floor(ddiff.valueOf()/1000); myTimeArray[<?=$i;?>]=Number(ddiff); <? } ?> CountBack(); <? } ?> </script> <? function drawFormRevolution($type, $action) { global $MSG_31_0027,$MSG_33_0020,$MSG_31_0035, $TPL_id_value, $auction_type, $MSG_31_0021,$MSG_33_0015,$MSG_31_0034,$MSG_240,$MSG_241; global $MSG_121, $MSG_30_0208, $TPL_next_bid_value, $TPL_title_value, $TPL_remained_bids, $TPL_id_value, $TPL_category_value; global $MSG_31_0031, $MSG_31_0030, $f5_num; if($type == "signup") { echo "<form name='bid' action='".$action."' method='post'> <table width=100% cellpadding=2> <tr> <td width=65%> <table width=100% cellpadding=2> <tr><td align=left>".$MSG_31_0027."</td></tr> </table> </td> <td valign='center' align='center' class='tema' width='50%'> <input type='hidden' name='id' value='".$TPL_id_value."'> <input type='hidden' name='auction_type' value='".$auction_type."'> <input type='hidden' name='form_type' value='".$type."'> <input type='hidden' name='f5_num' value='".$f5_num."'> <input type='submit' wsrc='themes/default/img/iscriviti.png' id='subbutton' name='subbutton' value='".$MSG_31_0021."' class='button'> </td> </tr> </table> </form>"; }else if($type == "play") { // echo "gggggg".$MSG_31_0027; // Form action URL $action = $SETTINGS['siteurl']; if($auction_type == 1)$action .= "bid_classic.php"; elseif($auction_type == 2)$action .= "bid_classic.php"; //------------------------------------------------------ //play echo " <table width=100%> <tr> <td> <table width=100%> <tr> <td> ".$MSG_31_0034." </td> <td colspan='2'> Bid In Range </td> <tr> <td width='50%'></td> <th align='left' width='25%'> ".$MSG_240." </th> <th align='left' width='25%'> ".$MSG_241." </th> </tr> <tr> <td valign='center' align='left' class='tema'> <form name='bid' action='".$action."' method='post'> <script> $(function() { $( '#slider2' ).slider2({ value:, min: 0.01, max: 100.00, step: 0.01, slide: function( event, ui ) { $( '#amount' ).val( '$' + ui.value ); } }); $( '#amount' ).val( '$' + $( '#slider2' ).slider2( 'value' ) ); }); </script> <div class="slider2"> <p> <input type=text name=bid size=6 id=amount style=border:0; color:#f6931f; font-weight:bold; /> </p> <div id=slider2></div> </div> <script> $(function() { $( '#slider1' ).slider1({ value:, min: 0.01, max: 100.00, step: 0.01, slide: function( event, ui ) { $( '#amount' ).val( '$' + ui.value ); } }); $( '#amount' ).val( '$' + $( '#slider1' ).slider1( 'value' ) ); }); </script> <div class=slider1> <p> <input type=text name=bid size=6 id=amount style=border:0; color:#f6931f; font-weight:bold; /> </p> <div id=slider1></div> </div> <input type='hidden' name='bid_next' value='".$TPL_next_bid_value."'> <input type='hidden' name='seller_id' value='0'> <input type='hidden' name='bid_type' value='simple'> <input type='hidden' name='title' value='".$TPL_title_value."' > <input type='hidden' name='category' value='".$TPL_category_value."' > <input type='hidden' name='id' value='".$TPL_id_value."'> <input type='hidden' name='auction_type' value='".$auction_type."'> <input type='hidden' name='form_type' value='".$type."'> <input type='hidden' name='f5_num' value='".$f5_num."'> <input type=submit id='subbutton' name='subbutton' value='BID' class='button' style='width:70px;'> </td></tr></table> </form> </td> <td valign='center' align='left' class='tema' colspan='2'> <form name='bid_range' action='".$action."' method='post'> <table><tr><td> <input type=text name=bid_from size=6 value='' /></td><td><input type=text name=bid_to size='6' value='' /> </td></tr><tr><td colspan='2'> <input type='hidden' name='bid_next' value='".$TPL_next_bid_value."'> <input type='hidden' name='seller_id' value='0'> <input type='hidden' name='bid_type' value='range'> <input type='hidden' name='title' value='".$TPL_title_value."' > <input type='hidden' name='category' value='".$TPL_category_value."' > <input type='hidden' name='id' value='".$TPL_id_value."'> <input type='hidden' name='t_remained_bids' value='".$remained_bids."'> <input type='hidden' name='auction_type' value='".$auction_type."'> <input type='hidden' name='form_type' value='".$type."'> <input type='hidden' name='f5_num' value='".$f5_num."'> <input type=submit id='subbutton' align='right' name='subbutton' value='BID' class='button' style='width:70px;'> </td></tr></table> </form> </td> </tr> </table> </td> </tr> <tr> <th colspan='2' align='left'> <br/> ".$MSG_33_0020." <ul> <li>1.00 USD -> 100 </li> <br> <li>1,56 Euro -> 156</li> <br> <li>1 Cent USD-> 1</li> </ul> </th> </tr> </table>"; }else if($type == "play_rebuy") { // play rebuy form echo " <table width=100% cellpadding=2 border=1> <tr> <td align='center' width=50%> <form name='bid' action='bid_revolution_rebuy.php' method='post'> <table width=100% cellpadding=2> <tr> <td align='left'>".$MSG_31_0034."<br><input type=text name=bid size=15 value='' /></td> </tr> <tr> <td valign='center' align='left' class='tema'> <input type='hidden' name='bid_next' value='".$TPL_next_bid_value."'> <input type='hidden' name='seller_id' value='0'> <input type='hidden' name='bid_type' value='simple'> <input type='hidden' name='title' value='".$TPL_title_value."' > <input type='hidden' name='category' value='".$TPL_category_value."' > <input type='hidden' name='id' value='".$TPL_id_value."'> <input type='hidden' name='auction_type' value='".$auction_type."'> <input type='hidden' name='form_type' value='".$type."'> <input type='hidden' name='f5_num' value='".$f5_num."'> <input type=submit id='subbutton' name='subbutton' value='".$MSG_31_0035."' class='button'> </td> </tr> </table> </form> </td> <td align='center' width=50%> <form name='bid_range' action='bid_revolution_rebuy.php' method='post'> <table width=100% cellpadding=2> <tr> <td align='left'>Bid In Range <br> ".$MSG_240." <input type=text name=bid_from size=10 value='' /><br/> ".$MSG_241." <input type=text name=bid_to size=10 value='' /> </tr> <tr> <td valign='center' align='left' class='tema'> <input type='hidden' name='bid_next' value='".$TPL_next_bid_value."'> <input type='hidden' name='seller_id' value='0'> <input type='hidden' name='bid_type' value='range'> <input type='hidden' name='title' value='".$TPL_title_value."' > <input type='hidden' name='category' value='".$TPL_category_value."' > <input type='hidden' name='id' value='".$TPL_id_value."'> <input type='hidden' name='auction_type' value='".$auction_type."'> <input type='hidden' name='form_type' value='".$type."'> <input type='hidden' name='f5_num' value='".$f5_num."'> <input type=submit id='subbutton' name='subbutton' value='".$MSG_31_0035."' class='button'> </td> </tr> </table> </form> </td> </tr> <tr> <td colspan='2' align='left'> ".$MSG_33_0020." <ul> <li>1.00 USD -> 100</li> <br> <li>1,56 Euro -> 156</li> <br> <li>1 Cent USD -> 1</li> </ul> </td> </tr> </table>"; } } ?> <table> <tr> <td> You must pay for shipping/handling of the item if you win the item. You may opt to receive a cash amount instead of the prize that will be transferred via Paypal. In order to opt for the cash amount; write an e-mail to support@luvbid.com with your username and the Auction ID of the auction you won. </td> <td> Currently only continental U.S resident may receive items won in auctions. If you are a not a resident of the continental U.S; you will receive a cash prize in the amount of the item that will be transferred electronically via Paypal. </td> </tr> </table> <? include phpa_include("template_user_menu_footer.html"); ?> Code: [Select] if ($month <= 9){ if ($list_day <= 9){ $event_day = $year.'-'."0".$month.'-'."0".$list_day; if(isset($events[$event_day])) { foreach($events[$event_day] as $event) { $calendar.= '<div class="event">'.$event['event_date'].'</div>'; } } } Right, using a mysql query the value from $event['event_Date'] prints out in a div. I need a number count of the amount of times this value is printed. any help? I have a website that has definitions and articles. I need a code that craws the php content pulled from my database, finds a specified word and replaced that word with a link. For example If "car" appears replace with <a href="http://www.website.com/car.php">car</a> Thanks Todd hello. say i have list and i want the correct children under each parent so i have $id $parent_id $type $name in the db i have 4 parents each with 2 children id=1 - type=parent - parent_id=0 - name=p1 id=2 - type=parent - parent_id=0 - name=p2 id=3 - type=parent - parent_id=0 - name=p3 id=4 - type=parent - parent_id=0 - name=p4 id=5 - type=child - parent_id=1 - name=c1 id=6 - type=child - parent_id=1 - name=c2 id=7 - type=child - parent_id=2 - name=c3 id=8 - type=child - parent_id=2 - name=c4 id=9 - type=child - parent_id=3 - name=c5 id=10 - type=child - parent_id=3 - name=c6 id=11 - type=child - parent_id=4 - name=c7 id=12 - type=child - parent_id=4 - name=c8 so how would i do the code? i thought i could do it like this but its not working. Code: [Select] <?php $family = Family::find_all(); foreach($family as $familys){ $id = $familys->id; $type = $familys->type; $parent_id = $familys->parent_id; $name = $familys->name; echo' <ul>'; if($type == "parent"){ echo $name; } echo' </ul> <li>'; if($type == "child" && $parent_id == $id){ echo $name; } echo' </li>'; } ?> all i get back is p1 p2 p3 p4 no children ?? if i remove Quote $parent_id == $id from Quote if($type == "child" && $parent_id == $id){ i get this p1 p2 p3 p4 c1 c2 c3 c4 c5 c6 c7 c8 but they are not listed under the correct parent i also tried moving the </ul> to the bottom but i get the same Code: [Select] <?php $family = Family::find_all(); foreach($family as $familys){ $id = $familys->id; $type = $familys->type; $parent_id = $familys->parent_id; $name = $familys->name; echo' <ul>'; if($type == "parent"){ echo $name; } echo' <li>'; if($type == "child"){ echo $name; } echo' </li> </ul>'; } ?> any thoughts? thanks rick im stuck on this section of code atm its failing on the line "or die(mysql_error());" i think its the $table ifs. ive tryed "" around the query but i get other errors then <?php if ($_GET['make'] == ''){ //no input //all if ($_GET['make'] == 'all'){ $table = $result6 = mysql_query("SELECT * FROM dsgi_serval where comments like '{$_GET['make']}'"); //pass if ($_GET['make'] == 'pass'){ $table = $result6 = mysql_query("SELECT * FROM dsgi_serval where comments like '{$_GET['make']}'"); //not pass if ($_GET['make'] == 'notpass'){ $table = $result6 = mysql_query("SELECT * FROM dsgi_serval where comments not like '{$_GET['make']}'"); }else{ //by make $table = $result6 = mysql_query("SELECT * FROM dsgi_serval where comments not like '{$_GET['make']}'"); } } } } ?> <div id="right"> <?php echo "$table"; or die(mysql_error()); $result=mysql_query($sql); ?> Hello. i have some code that works with out using parent and child but i dont think im doing it in the correct oop way. would someone maybe please just have a little look for me please. by the way.. i know im not ment to use global but thats how i was shown to do that on my tutorial videos.. i'll address that in another post so. in this example i have this pages class Code: [Select] <?PHP require_once(LIB_PATH.DS.'database.php'); class Pages { protected static $table_name="pages"; protected static $db_fields = array( 'id', 'pageName', 'contTemp_id', 'contElements_id', 'title', 'sub_title', 'description', 'about', 'image', 'created', 'dateMod', 'timeMod'); public $id; public $pageName; public $contTemp_id; public $contElements_id; public $title; public $sub_title; public $description; public $about; public $image; public $created; public $dateMod; public $timeMod; // "new" is a reserved word so we use "make"(or "build") public static function make( $id="", $pageName="", $contTemp_id="", $contElements_id="", $title="", $sub_title="", $description="", $about="", $image="", $created="", $dateMod="", $timeMod="") { if(!empty($title)) { $kw = new NavL3(); $kw->id = (int)$id; $kw->pageName = $pageName; $kw->contTemp_id = (int)$contTemp_id; $kw->contElements_id = (int)$contElements_id; $kw->title = $title; $kw->sub_title = $sub_title; $kw->description = $description; $kw->about = $about; $kw->image = $image; $kw->created = $created; $kw->dateMod = $dateMod; $kw->timeMod = $timeMod; return $kw; }else{ return false; } } //end function make public static function find_by_pageName($id){ global $database; $sql = "SELECT * FROM ".self::$table_name." WHERE id='".$database->escape_value($id)."'"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } public static function find_by_pageID($pageID=0){ global $database; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$database->escape_value($pageID)." LIMIT 1"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } // Common Database Methods public static function find_all(){ global $database; $sql = "SELECT * FROM ".self::$table_name.""; return self::find_by_sql($sql); } public static function find_by_id($id=0){ global $database; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$database->escape_value($id)." LIMIT 1"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } public static function find_by_sql($sql){ global $database; $results_set = $database->query($sql); $object_array = array(); while($row = $database->fetch_array($results_set)){ $object_array[] = self::instantiate($row); } return $object_array; } public static function count_all(){ global $database; $sql = "SELECT COUNT(*) FROM ".self::$table_name; $results_set = $database->query($sql); $row = $database->fetch_array($results_set); return array_shift($row); } public static function instantiate($result){ $object = new self; foreach($result as $attribute => $value){ if($object->has_attribute($attribute)){ $object->$attribute = $value; } } return $object; } private function has_attribute($attribute){ $object_vars = $this->attributes(); return array_key_exists($attribute, $object_vars); } protected function attributes(){ $attributes = array(); foreach(self::$db_fields as $field){ if(property_exists($this, $field)){ $attributes[$field] = $this->$field; } } return $attributes; } protected function sanitized_attributes(){ global $database; $clean_attributes = array(); foreach($this->attributes() as $key => $value){ $clean_attributes[$key] = $database->escape_value($value); } return $clean_attributes; } public function save(){ return !empty($this->id) ? $this->update() : $this->create(); } public function create(){ global $database; $attributes = $this->sanitized_attributes(); $sql = "INSERT INTO ".self::$table_name." ("; $sql .= join(", ", array_keys($attributes)); $sql .= ") VALUES ('"; $sql .= join("', '", array_values($attributes)); $sql .= "')"; if($database->query($sql)){ $this->id = $database->insert_id(); return true; }else{ return false; } } public function update(){ global $database; $attributes = $this->sanitized_attributes(); $attribute_pairs = array(); foreach($attributes as $key => $value){ $attribute_pairs[] = "{$key}='{$value}'"; } $sql = "UPDATE ".self::$table_name." SET "; $sql .= join(", ", $attribute_pairs); $sql .= " WHERE id=".$database->escape_value($this->id); $database->query($sql); return ($database->affected_rows() == 1) ? true : false; } public function delete(){ global $database; $sql = "DELETE FROM ".self::$table_name." "; $sql .= "WHERE id=".$database->escape_value($this->id); $sql .= " LIMIT 1"; $database->query($sql); return ($database->affected_rows() == 1) ? true : false; } } //end class blogs ?> and i have this conttemp class Code: [Select] <?PHP require_once(LIB_PATH.DS.'database.php'); class Conttemps { protected static $table_name="contTemps"; protected static $db_fields = array( 'id', 'name', 'created', 'dateMod', 'timeMod'); public $id; public $name; public $created; public $dateMod; public $timeMod; // "new" is a reserved word so we use "make"(or "build") public static function make( $id, $name="", $created="", $dateMod="", $timeMod="") { if(!empty($name)) { $kw = new Templates(); $kw->id = (int)$id; $kw->name = $name; $kw->created = $created; $kw->dateMod = $dateMod; $kw->timeMod = $timeMod; return $kw; }else{ return false; } } //end function make public function find_contTemp($pageID){ $page = Pages::find_by_pageID($pageID); $pageCID = $page->contTemp_id; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$pageCID.""; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } // Common Database Methods public static function find_all(){ global $database; $sql = "SELECT * FROM ".self::$table_name.""; return self::find_by_sql($sql); } public static function find_by_id($id=0){ global $database; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$database->escape_value($id)." LIMIT 1"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } public static function find_by_sql($sql){ global $database; $results_set = $database->query($sql); $object_array = array(); while($row = $database->fetch_array($results_set)){ $object_array[] = self::instantiate($row); } return $object_array; } public static function count_all(){ global $database; $sql = "SELECT COUNT(*) FROM ".self::$table_name; $results_set = $database->query($sql); $row = $database->fetch_array($results_set); return array_shift($row); } public static function instantiate($result){ $object = new self; foreach($result as $attribute => $value){ if($object->has_attribute($attribute)){ $object->$attribute = $value; } } return $object; } private function has_attribute($attribute){ $object_vars = $this->attributes(); return array_key_exists($attribute, $object_vars); } protected function attributes(){ $attributes = array(); foreach(self::$db_fields as $field){ if(property_exists($this, $field)){ $attributes[$field] = $this->$field; } } return $attributes; } protected function sanitized_attributes(){ global $database; $clean_attributes = array(); foreach($this->attributes() as $key => $value){ $clean_attributes[$key] = $database->escape_value($value); } return $clean_attributes; } public function save(){ return !empty($this->id) ? $this->update() : $this->create(); } public function create(){ global $database; $attributes = $this->sanitized_attributes(); $sql = "INSERT INTO ".self::$table_name." ("; $sql .= join(", ", array_keys($attributes)); $sql .= ") VALUES ('"; $sql .= join("', '", array_values($attributes)); $sql .= "')"; if($database->query($sql)){ $this->id = $database->insert_id(); return true; }else{ return false; } } public function update(){ global $database; $attributes = $this->sanitized_attributes(); $attribute_pairs = array(); foreach($attributes as $key => $value){ $attribute_pairs[] = "{$key}='{$value}'"; } $sql = "UPDATE ".self::$table_name." SET "; $sql .= join(", ", $attribute_pairs); $sql .= " WHERE id=".$database->escape_value($this->id); $database->query($sql); return ($database->affected_rows() == 1) ? true : false; } public function delete(){ global $database; $sql = "DELETE FROM ".self::$table_name." "; $sql .= "WHERE id=".$database->escape_value($this->id); $sql .= " LIMIT 1"; $database->query($sql); return ($database->affected_rows() == 1) ? true : false; } } //end class blogs ?> the bit im interested in is this function in the Conttemp class Code: [Select] public function find_contTemp($pageID){ $page = Pages::find_by_pageID($pageID); $pageCID = $page->contTemp_id; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$pageCID.""; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } it call a function in from the Pages class. i could take the function from here and put it in the Pages class i guess but i was wondering about Exends. should i do class Conttemps extends Pages { and use something like Code: [Select] public function find_contTemp($pageID){ $pageCID= Pages::contTemp_id; $sql = "SELECT * FROM ".self::$table_name." WHERE id=".$pageCID.""; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } i guess that wont work because its not getting the $pageID but anyway.. any thoughts ???? thanks rick When displaying a webpage within iframe of facebook fan page, how I can detect that my page is viewed within the facebook iframe? I want to have a if else statement to change something within the page if it is viewed through facebook fanpage (not by direct visit). Is there a way to get what page included it? For example, if index.php includes header.php, how can header.php display 'index.php' automatically? how do i find out if a parent has any children? for example id - name - parent_id 1 - title1 - 0 (parent) 2 - title2 - 0 (parent) 3 - link1 - 1 (child) 4 - link2 - 1 (child) 5 - link3 - 2 (child) 5 - link4 - 2 (child) the above has 2 parent with 2 links each. so.. if an id has no "parent_id" pointing to it must be a child if an id has "parent_id" pointing to it must be a parent i have a list Code: [Select] <ul> <li><a href="">'.$link.'</a></li> <li><a href="" class="subTitle">'.$title.'</a> <ul class="subLink"> <li><a href="">'.$link.'</a></li> </ul> </li> </ul> so i want to do something like if id has no "parent_id" pointing to it, it is a $link if id has "parent_id" pointing to it, it is a $title any thoughts thanks I have one table but i try to make like the result not finished.
Hmm.. can you see my table :
FireShot Screen Capture #003 - 'localhost _ 127_0_0_1 _ pmis_dbase _ rekening_kegiatan I phpMyAdmin 4_0_4_1' - localhost_phpmyadmin_index_php_db=pmis_dbase&table=rekening_kegiatan&target=sql_php&token=93960ef7b5.png 803.36KB
0 downloads
I want to declare sum for parent kd_rekening in same row for "Anggaran" => jns_anggaran =1 and "Perubahan" => jns_anggaran = 2. And child ust load field nilai. Untitled.jpg 34.7KB 0 downloads Thanks before Is it possible to have a class access another class it its parent directory without using a fully qualified name? While the following script is not valid, it is how I would have thought it would be done should it be possible. If it is not possible, I expect there is a good reason why one would not want to do so, and would appreciate your thoughts why that is so. Thanks // src/PrimaryTopic/SubTopic/SubSubTopic/ParentClass.php namespace PrimaryTopic\SubTopic\SubSubTopic; class ParentClass {} // src/PrimaryTopic/SubTopic/SubSubTopic/Child/ChildClass1.php namespace PrimaryTopic\SubTopic\SubSubTopic\Child; class ChildClass1 extends ..\ParentClass {} // src/PrimaryTopic/SubTopic/SubSubTopic/Child/ChildClass2.php namespace PrimaryTopic\SubTopic\SubSubTopic\Child; class ChildClass2 extends ..\ParentClass {}
|