 |
|
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-fou
|
| Sign In·View Thread·PermaLink | 5.00/5 (2 votes) |
|
|
|
 |
|
 |
In Windows hosting $ud=fopen("..\html/vol.html","w"); it is working but not working in Linux hosting what i need to change ?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hi guys, pls i am a new member of this site, anyways i am having troubles in connecting my php code to my database pls how can i do dat. thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all!
Im trying to put my skype nick and yahoo nick into my site.
How can i set the images for skype or yahoo messenger when i online and offline following bellow:
If im online:the skype image is skypeonline.jpg.
If im ofline:the skype image is skypeoffline.jpg.
If im online:the yahoo image is yahooonline.jpg.
If im ofline:the yahoo image is yahoooffline.jpg.
Thanks a lot!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello all,
I am working on a php script to generate an image with the barcode 128 B (I will not be using the A or C).
I have it displaying a barcode in firefox. When I print it it looks close to one generanted by a barcode application. The diference is that mine is slightly longer. Anyways given the same string the app generate code scans and mine does not. I believe everything is in order...but I must be missing something simple here...suggestions?
This is the hash_code_128.php script referenced in the main script. The source for the codes came from wikipedia http://en.wikipedia.org/wiki/Code_128[^]
<?php $b_chr = array(); $b_enc = array(); $stop = "11000111010"; $term_bar = "11"; $b_chr['00'] = " "; $b_chr['01'] = "!"; $b_chr['02'] = '"'; $b_chr['03'] = "#"; $b_chr['04'] = "$"; $b_chr['05'] = "%"; $b_chr['06'] = "&"; $b_chr['07'] = "'"; $b_chr['08'] = "("; $b_chr['09'] = ")"; $b_chr['10'] = "*"; $b_chr['11'] = "+"; $b_chr['12'] = ","; $b_chr['13'] = "-"; $b_chr['14'] = "."; $b_chr['15'] = "/"; $b_chr['16'] = "0"; $b_chr['17'] = "1"; $b_chr['18'] = "2"; $b_chr['19'] = "3"; $b_chr['20'] = "4"; $b_chr['21'] = "5"; $b_chr['22'] = "6"; $b_chr['23'] = "7"; $b_chr['24'] = "8"; $b_chr['25'] = "9"; $b_chr['26'] = ":"; $b_chr['27'] = ";"; $b_chr['28'] = "<"; $b_chr['29'] = "="; $b_chr['30'] = ">"; $b_chr['31'] = "?"; $b_chr['32'] = "@"; $b_chr['33'] = "A"; $b_chr['34'] = "B"; $b_chr['35'] = "C"; $b_chr['36'] = "D"; $b_chr['37'] = "E"; $b_chr['38'] = "F"; $b_chr['39'] = "G"; $b_chr['40'] = "H"; $b_chr['41'] = "I"; $b_chr['42'] = "J"; $b_chr['43'] = "K"; $b_chr['44'] = "L"; $b_chr['45'] = "M"; $b_chr['46'] = "N"; $b_chr['47'] = "O"; $b_chr['48'] = "P"; $b_chr['49'] = "Q"; $b_chr['50'] = "R"; $b_chr['51'] = "S"; $b_chr['52'] = "T"; $b_chr['53'] = "U"; $b_chr['54'] = "V"; $b_chr['55'] = "W"; $b_chr['56'] = "X"; $b_chr['57'] = "Y"; $b_chr['58'] = "Z"; $b_chr['59'] = "["; $b_chr['60'] = "\\"; $b_chr['61'] = "]"; $b_chr['62'] = "^"; $b_chr['63'] = "_"; $b_chr['64'] = "`"; $b_chr['65'] = "a"; $b_chr['66'] = "b"; $b_chr['67'] = "c"; $b_chr['68'] = "d"; $b_chr['69'] = "e"; $b_chr['70'] = "f"; $b_chr['71'] = "g"; $b_chr['72'] = "h"; $b_chr['73'] = "i"; $b_chr['74'] = "j"; $b_chr['75'] = "k"; $b_chr['76'] = "l"; $b_chr['77'] = "m"; $b_chr['78'] = "n"; $b_chr['79'] = "o"; $b_chr['80'] = "p"; $b_chr['81'] = "q"; $b_chr['82'] = "r"; $b_chr['83'] = "s"; $b_chr['84'] = "t"; $b_chr['85'] = "u"; $b_chr['86'] = "v"; $b_chr['87'] = "w"; $b_chr['88'] = "x"; $b_chr['89'] = "y"; $b_chr['90'] = "z"; $b_chr['91'] = "{"; $b_chr['92'] = "|"; $b_chr['93'] = "}"; $b_chr['94'] = "~"; $b_chr['95'] = "DEL"; $b_chr['96'] = "FNC3"; $b_chr['97'] = "FNC2"; $b_chr['98'] = "SHIFT"; $b_chr['99'] = "Code C"; $b_chr['100'] = "FNC4"; $b_chr['101'] = "Code A"; $b_chr['102'] = "FNC1"; $b_chr['103'] = "START A"; $b_chr['104'] = "START B"; $b_chr['105'] = "START C"; $b_enc['00'] = "11011001100"; $b_enc['01'] = "11001101100"; $b_enc['02'] = "11001100110"; $b_enc['03'] = "10010011000"; $b_enc['04'] = "10010001100"; $b_enc['05'] = "10001001100"; $b_enc['06'] = "10011001000"; $b_enc['07'] = "10011000100"; $b_enc['08'] = "10001100100"; $b_enc['09'] = "11001001000"; $b_enc['10'] = "11001000100"; $b_enc['11'] = "11000100100"; $b_enc['12'] = "10110011100"; $b_enc['13'] = "10011011100"; $b_enc['14'] = "10011001110"; $b_enc['15'] = "10111001100"; $b_enc['16'] = "10011101100"; $b_enc['17'] = "10011100110"; $b_enc['18'] = "11001110010"; $b_enc['19'] = "11001011100"; $b_enc['20'] = "11001001110"; $b_enc['21'] = "11011100100"; $b_enc['22'] = "11001110100"; $b_enc['23'] = "11101101110"; $b_enc['24'] = "11101001100"; $b_enc['25'] = "11100101100"; $b_enc['26'] = "11100100110"; $b_enc['27'] = "11101100100"; $b_enc['28'] = "11100110100"; $b_enc['29'] = "11100110010"; $b_enc['30'] = "11011011000"; $b_enc['31'] = "11011000110"; $b_enc['32'] = "11000110110"; $b_enc['33'] = "10100011000"; $b_enc['34'] = "10001011000"; $b_enc['35'] = "10001000110"; $b_enc['36'] = "10110001000"; $b_enc['37'] = "10001101000"; $b_enc['38'] = "10001100010"; $b_enc['39'] = "11010001000"; $b_enc['40'] = "11000101000"; $b_enc['41'] = "11000100010"; $b_enc['42'] = "10110111000"; $b_enc['43'] = "10110001110"; $b_enc['44'] = "10001101110"; $b_enc['45'] = "10111011000"; $b_enc['46'] = "10111000110"; $b_enc['47'] = "10001110110"; $b_enc['48'] = "11101110110"; $b_enc['49'] = "11010001110"; $b_enc['50'] = "11000101110"; $b_enc['51'] = "11011101000"; $b_enc['52'] = "11011100010"; $b_enc['53'] = "11011101110"; $b_enc['54'] = "11101011000"; $b_enc['55'] = "11101000110"; $b_enc['56'] = "11100010110"; $b_enc['57'] = "11101101000"; $b_enc['58'] = "11101100010"; $b_enc['59'] = "11100011010"; $b_enc['60'] = "11101111010"; $b_enc['61'] = "11001000010"; $b_enc['62'] = "11110001010"; $b_enc['63'] = "10100110000"; $b_enc['64'] = "10100001100"; $b_enc['65'] = "10010110000"; $b_enc['66'] = "10010000110"; $b_enc['67'] = "10000101100"; $b_enc['68'] = "10000100110"; $b_enc['69'] = "10110010000"; $b_enc['70'] = "10110000100"; $b_enc['71'] = "10011010000"; $b_enc['72'] = "10011000010"; $b_enc['73'] = "10000110100"; $b_enc['74'] = "10000110010"; $b_enc['75'] = "11000010010"; $b_enc['76'] = "11001010000"; $b_enc['77'] = "11110111010"; $b_enc['78'] = "11000010100"; $b_enc['79'] = "10001111010"; $b_enc['80'] = "10100111100"; $b_enc['81'] = "10010111100"; $b_enc['82'] = "10010011110"; $b_enc['83'] = "10111100100"; $b_enc['84'] = "10011110100"; $b_enc['85'] = "10011110010"; $b_enc['86'] = "11110100100"; $b_enc['87'] = "11110010100"; $b_enc['88'] = "11110010010"; $b_enc['89'] = "11011011110"; $b_enc['90'] = "11011110110"; $b_enc['91'] = "11110110110"; $b_enc['92'] = "10101111000"; $b_enc['93'] = "10100011110"; $b_enc['94'] = "10001011110"; $b_enc['95'] = "10111101000"; $b_enc['96'] = "10111100010"; $b_enc['97'] = "11110101000"; $b_enc['98'] = "11110100010"; $b_enc['99'] = "10111011110"; $b_enc['100'] = "10111101110"; $b_enc['101'] = "11101011110"; $b_enc['102'] = "11110101110"; $b_enc['103'] = "11010000100"; $b_enc['104'] = "11010010000"; $b_enc['105'] = "11010011100"; ?>
This is the main code page it is called from another page using a html img tags src attribute, like <img src='gen_code_128b.php?string=BarCode 1&size=2&height=50'>
<?php $string=urldecode($_GET['string']); $size=urldecode($_GET['size']); $height=urldecode($_GET['height']); include('hash_code_128.php'); $bcstring = ''; $cnt = strlen($string) ; $quiet_zone = 10*$size-1; $pad_top = 5; $pad_text = 3; $font_size = 5; $pad_bottom = 5; $font_left = $quiet_zone; $font_top = $pad_text + $height; $ttl_width = ($quiet_zone*2)+($size*($cnt+3)*11)+2; $ttl_height = $pad_top + $pad_text + $font_size + $pad_bottom + $height; $running_checksum = 104; $bcstring.=$b_enc['104']; for($i=0;$i<$cnt;$i++) { $position = $i+1; $key = array_search($string[$i],$b_chr,true); $bcstring.=$b_enc[$key]; $running_checksum+=($position*$key); } $checksum = $running_checksum%103; $bcstring.=$b_enc[$checksum].$stop.$term_bar;
header ('Content-type: image/png'); $im = @imagecreatetruecolor($ttl_width, $ttl_height) or die('Cannot Initialize new GD image stream'); $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); imagefill($im, 0, 0, $white); $start_x = 0; $stop_x = 1; $last_char = '0'; $bc_cnt = strlen($bcstring); for($i=0;$i<$bc_cnt;$i++) { if($bcstring[$i]==1 && $bcstring[$i]!=$last_char) { $start_x = $quiet_zone+($i*$size); } if($bcstring[$i]==1 && $bcstring[$i]==$last_char) { $stop_x++; } if($bcstring[$i]==0 && $bcstring[$i]!=$last_char) { imagefilledrectangle($im, $start_x, $pad_top, $start_x+($stop_x*$size)-1, $height, $black); $stop_x = 1; } $last_char = $bcstring[$i]; } imagestring($im, 3, $font_left, $font_top, $string, $black); imagepng($im); imagedestroy($im); ?>
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I came across this a while ago - dunno if it'll help:
<?php
function UPCAbarcode($code) { $lw = 2; $hi = 100; $Lencode = array('0001101','0011001','0010011','0111101','0100011', '0110001','0101111','0111011','0110111','0001011'); $Rencode = array('1110010','1100110','1101100','1000010','1011100', '1001110','1010000','1000100','1001000','1110100'); $ends = '101'; $center = '01010'; if ( strlen($code) != 11 ) { die("UPC-A Must be 11 digits."); } $ncode = '0'.$code; $even = 0; $odd = 0; for ($x=0;$x<12;$x++) { if ($x % 2) { $odd += $ncode[$x]; } else { $even += $ncode[$x]; } } $code.=(10 - (($odd * 3 + $even) % 10)) % 10; $bars=$ends; $bars.=$Lencode[$code[0]]; for($x=1;$x<6;$x++) { $bars.=$Lencode[$code[$x]]; } $bars.=$center; for($x=6;$x<12;$x++) { $bars.=$Rencode[$code[$x]]; } $bars.=$ends; $img = ImageCreate($lw*95+30,$hi+30); $fg = ImageColorAllocate($img, 0, 0, 0); $bg = ImageColorAllocate($img, 255, 255, 255); ImageFilledRectangle($img, 0, 0, $lw*95+30, $hi+30, $bg); $shift=10; for ($x=0;$x if (($x<10) || ($x>=45 && $x<50) || ($x >=85)) { $sh=10; } else { $sh=0; } if ($bars[$x] == '1') { $color = $fg; } else { $color = $bg; } ImageFilledRectangle($img, ($x*$lw)+15,5,($x+1)*$lw+14,$hi+5+$sh,$color); } ImageString($img,4,5,$hi-5,$code[0],$fg); for ($x=0;$x<5;$x++) { ImageString($img,5,$lw*(13+$x*6)+15,$hi+5,$code[$x+1],$fg); ImageString($img,5,$lw*(53+$x*6)+15,$hi+5,$code[$x+6],$fg); } ImageString($img,4,$lw*95+17,$hi-5,$code[11],$fg); header("Content-Type: image/png"); ImagePNG($img); }
UPCAbarcode('12345678901');
?>
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I got it working. I had a few issues that needed to be adressed.
1) My checksum made a mistake of just using the modulus value as a lookup, when I really needed to add 32 to the value and find the ascii character it represents. Then I can find the hash code based on that and add it to the bar code string.
$checksum = $checksum + 32; $checksum2 = chr($checksum); $key = array_search($checksum2,$b_chr,true); $bcstring.=$b_enc[$key].$stop.$term_bar;
2) I did not draw the final termination barcode in my for loop due to a simple logic error. I corrected it with and a "or" to check for the end of the barcode string so I write the last part.
if($bcstring[$i]==0 && $bcstring[$i]!=$last_char || $i == $bc_cnt-1) { imagefilledrectangle($im, $start_x, $pad_top, $start_x+($stop_x*$size)-1, $height, $black); $stop_x = 1; }
it is all working. If anyone wants to use this code, enjoy!
Of course a mention is always nice 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
<?php $url = "http://www.nseindia.com/content/equities/TopGainers.htm"; $html = strtolower(implode('', file($url))); echo $html; ?>
Why i am unable to read this file ?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Hey my friends ... I was using mail() function but some error occured
this is the code
$to='compnay@yahoo.com';$from=$_POST['txtEmail']; $title=$_POST['txtTitle']; $body=$_POST['txtMsg'];
if($_POST['form1'].submit) { mail($to,$title,$body,'From:'.' '.$from); echo '<h1 >Thank you! </h1> <p>Email sent. We will contact you as soon as possible </p><p><br /></p>';
} else echo 'not submitted';
?>
when I use the above code this error occured
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Hiwi\send.php on line 26 Thank you!
Email sent. We will contact you as soon as possible
Can any body help me on this? I thought it was because I wasnt connected to the internet ..... even after I connected to the internet it comes again. Is it because my site is not posted ? I am just working on it....
Any suggestions ....
Thank you
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
CoderForEver wrote: Failed to connect to mailserver at "localhost"
I take it you don't have an SMTP server on your localhost as that is what the error means.
You need to configure your php.ini with SMTP settings for a different, external SMTP server if you don't have one installed on your localhost.
You can find lots of information about your problem by doing a simple Google search[^] with your error message.
If at first you don't succeed, you're not Chuck Norris.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
thank you man .... I already checked the SMTP .... I use Wamp Server just for to develop my websites. .... I will check ur soulutions
Thank you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Yes. but it's easier to work with csv (comma separated value) files. you can export/import csv files from excel.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for your help brother. I am downloading .xls file from a website it is not in csv format there. can you Suggest me where i get information how to read .xml in php or any command?
Thank You
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I assume that it's your intention for the last line to be repeated?
Why not just run through a loop, printing out a string and adding an extra character to it each iteration. Once the loop has been run the correct number of times, print the last result again and you're done!
Think about the output needed:
*<br> **<br> ***<br> ****<br> *****<br> *****<br>
Clearly, displaying each line involves printing the text, followed by printing a <br>
Perhaps you'd find the output line looking something like this:
printf("%s<br>", $starString);
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
IMO echo "*<br />**<br />***<br />****<br />*****<br />*****"; would suffice.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have 2 computer, they are connected together through a switch so i 've got LAN(my system just only 2 computers and has no connect to the Internet( no modem or router))
pc001 I got ip 192.168.1.1 pc002 I got ip 192.168.1.2
on pc001 i install xampp.
I hosting some website at pc001 and have some situation like bellow:
1.All website i created by Joomla work well and i can access these website from another computer(Everything good)
2.I created a forum (using MyBB Forum) , it work well when i access on the local computer(the computer which install xampp). When i access forum from pc002 the result is not displayed correctly.
Can anybody help me to fixed this.
Thanks and regards
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Check your configuration of your MyBB Forum is using the pc name / ip address as the hostname and not "localhost"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hey friends I am developing web page for some music production. What I wanted to ask is, there are a lot of links for a lot of lyrics. If I put the lyrics with their file name and when the user presses the link it reads the file and displays on a new page. But this is really bad(too slow). So I decided to do like CODEPROJECT's site did. i.e when we click one question(or answer) on a thread it display the message @ that page with in a fraction of mili second. So can any body help me how to do that so that I can display the lyrics next to the song as CodeProject's thread did?
I hope I will get some helps soon. Thank you
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |