-
Posts
122 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
runeveryday's Achievements

Regular Member (3/5)
0
Reputation
-
the home page is ok. but the inner page still doesn't work. could you see http://www.scarvesonsale.com/index.php/sweet-long-chiffon-scarf.html this page. thank you
-
when i click the left/right arrow which locates at the center of the home page. the image can't remove.but ok under firefox. why? how to correct it. thank you. it works ok under Chrome and firefox. but doesn't work when under Internet Explorer 8. when under Internet Explorer 8, the products under NEW PRODUCTS are all dispayed
-
There are 50 csv files. each csv file have the same column's name. some content in the column are the same, some don't. egļ¼test1.csv, example1.csv, hello.csv, world.csv.......test70.csv. now, i want to make a change to two column's content. a, all csv files have a column named qty. whose rows content are all 0. now, i want to change it into 888 b, all csv files have a column named image. whose rows content are all upload/img1.jpg upload/img2.jpg upload/img3.jpg upload/img01.jpg upload/img14.jpg upload/img01.jpg ....... If i open each csv file then do a search and replace. i fell it too bored. Thank you in advance. i want to delete Uploadin the image column, change 0 to 888 in the qty column. i using the file change.php to update the record. one csv file. http://phplist.xxmn.com/women.csv the code: <?php $dir = getcwd(); $files = array_diff(scandir($dir), array('..', '.','change.php')); foreach ($files as $file) { if (($handle = fopen($file, "r")) !== FALSE) { $new_content = ''; while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) { //var_dump($data); $data[2]=888; $new_content .= implode(',', $data); //var_dump($new_content); } file_put_contents($file, $new_content); echo 'down'; } } ?> the code doesn't work how to correct it . thank u
-
setInterval((function() { var index = -1; return function() { var all = $('#latest a'); if (index >= 0) { all.eq(index).hide(); } index++; if (index == all.length) { index = 0; } all.eq(index).show(); }; })(), 1000); how the code is executed? when index = -1; it not fit the first if condition, then execute index++; then which step the code will be executed? if (index >= 0) or if (index == all.length) why?
-
$col = 0; if ($num_products_count > 0) { while (!$specials_index->EOF) { $list_box_contents[$row][$col] = array('params' =>'<a href="#">' .zen_image(..). '</a>'), $col ++; } } now i want to pass some values<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg"> to zen_image(..). how should i do? namely, if there are five loops.i want to change zen_image(..) output result to (<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg">)
-
many thanks. but there are some points i am still confused. 1, how do i know the port number is 43 2, what's the aim of writting the $domain to the $conn
-
what's the purpose of writes the domain string (plus a carriage return and new line feed characters) to the stream? thank you.
-
if ($conn = fsockopen ("whois.internic.net", 43)) { fputs($conn, $domain."\r\n"); while(!feof($conn)) { $output .= fgets($conn,128); } fclose($conn); what those code meaning? how to know what ther result of the $conn. thank you. the code is form http://www.codesphp.com/php-category/http/php-whois-query-function-to-query-some-nic-databases.html fputs($conn, $domain."\r\n"); why he write the $domain."\r\n" to $conn
-
i am sorry,i am a newbie of php, i have read some tutorial of them, but still don't know when and how i should use them. expect someone can make me a simple example to demonstrate them. many thanks.
-
got it. many many thanks.
-
the system is window xp.now,i made the following test. test code: putenv('GDFONTPATH=C:\WINDOWS\Fonts'); $fontname='arial'; $char="test"; $size=20; $bbox=imagettfbbox($size,0,$fontname,$char); it show invalidate font filename...., but the arial is actually in C:\WINDOWS\Fonts
-
what's wrong with the php generate image bar chart code?
runeveryday replied to runeveryday's topic in PHP Coding Help
the sql command is right, i added print_r($result); there are some output of it. may be the font path is wrong? but how to correct it. thank you. i added the $bar_height =20, the code still doesn't run. -
the database is right: DATABASE `poll`; TABLE `results` CREATE TABLE `results` ( book_type VARCHAR(50), num_votes INT ); INSERT INTO `results` values ('Classic', 15), ('Fantasy', 7), ('Humor', 32), ('Mystery', 12), ('Poetry', 25); the code: <?php $dbhandle = mysql_connect("localhost","root","123") or die("unable to connect to mysql"); $selected = mysql_select_db("poll",$dbhandle); $result = mysql_query("SELECT * FORM results"); $num_poller = mysql_num_rows($result); $total_votes = 0; while($row = mysql_fetch_array($result)){ $total_votes += $row{'num_votes'}; } mysql_data_seek($result,0); mysql_close($dbhandle); putenv('GDFONTPATH=C:\WINDOWS\Fonts'); $font = 'arial'; $y = 50; $width =700; $height = $num_poller * $bar_height *1.5 + 70; $bar_unit = ($width - 400)/100; $image = imagecreate($width,$height); $white = imagecolorallocate($image,255,255,255); $black = imagecolorallocate($image,0,0,0); $red = imagecolorallocate($image,255,0,0); $blue = imagecolorallocate($image,0,0,255); imagefill($image,$width,$height,$white); imagerectangle($image,0,0,$width-1,$height-1,$black); imagettftext($image,16,0,$width/3+50,$y-20,$black,$font,'poll results'); while($row = mysql_fetch_object($result)){ if($total_votes > 0){ $percent = intval(round(($row->num_votes/$total_votes)*100)); }else{ $percent =0; } imagettftext($image,12,0,10, $y+($bar_height/2), $black, $font, $row->book_type); //Output percentage for a particular value imagettftext($image, 12, 0, 170, $y + ($bar_height/2),$red,$font,$percent.'%'); $bar_length = $percent * $bar_unit; //Draw a shape that corresponds to 100% imagerectangle($image, $bar_length+221, $y-2, (220+(100*$bar_unit)), $y+$bar_height, $black); //Output a bar for a particular value imagefilledrectangle($image,220,$y-2,220+$bar_length, $y+$bar_height, $blue); //Output the number of votes imagettftext($image, 12, 0, 250+100*$bar_unit, $y+($bar_height/2), $black, $font, $row->num_votes.' votes cast.'); $y = $y + ($bar_height * 1.5); } header("Content-Type: image/jpeg"); imagejpeg($image); imagedestroy($image); it shows an error: the image...cannot be displayed because it contains errors?. what's wrong with the code? thank you
-
Hi, I'm trying to use Zeroclipboard. http://code.google.com/p/zeroclipboard/. Zeroclipboard to copy stuff to the clipboard and add a tooltip when the mouse hover on the flash. but it doesn't seem to be working. my html code: <div rel="<?php echo $url;?>" class="cp-code">copied code</div> <div class="test" style="display: none; border: 1px solid #ccc; padding: 8px;">click copy,test,test</div> My js code: i have added the jquery library. ZeroClipboard.setMoviePath("http://example.com/js/ZeroClipboard.swf"); var clip = null; var url = ''; function init() { clip = new ZeroClipboard.Client(); clip.setHandCursor( true ); $('.cp-code').mouseover( function() { clip.setText(this.innerHTML); $('test').style.display = 'block'; if (clip.div) { clip.receiveEvent('mouseout', null); clip.reposition(this); } else { clip.glue(this); } clip.receiveEvent('mouseover', null); url = $(this).attr('rel'); }); clip.addEventListener('mouseUp', function(client) { window.open(url); }); clip.addEventListener('mouseOut', function (client) { $('test').style.display = 'none'; }); } $(document).ready(function() { init(); });