Jump to content

thepip3r

Members
  • Posts

    289
  • Joined

  • Last visited

    Never

Everything posted by thepip3r

  1. this might have to do with the fact that I haven't downloaded GD-2.  I just downloaded the .zip for my windows server but where do I put the extracted folder and how do i tell PHP to use the contents??? the man page for GD doesn't say... just says to enable the extension.
  2. Well I figured out my Header errors and now I don't get any errors.. I just get gibberish.  I'm using the exact code (almost) from the link you posted Barand but my output is the following: [quote]‰PNG  IHDR, ¥Èhd PLTEàààÿÿ™"ÂIDATxœc¥`p` `5kÔ¬!có Ñ4Y®S…¿IEND®B`‚ [/quote] [code=php:0]// set dimensions     $w = 300;     $h = 12; // create image     $im = imagecreate($w, $h); // set colours to be used     $bg = imagecolorallocate($im, 0xE0, 0xE0, 0xE0);     $black = imagecolorallocate($im, 0x00, 0x00, 0x00);     $barcolor  = imagecolorallocate($im, 0xFF, 0xFF, 0x00); // draw border     imagerectangle($im, 0,0,$w-1,$h-1,$black); // get value and max value from query string     $val = 0;     $max = 100; // calculate dimensions of inner bar     $barw = $max ? floor(($w-2) * $val / $max) : 0;     $barh = $h - 2; // draw inner bar if ($barw)     imagefilledrectangle($im, 1, 1, $barw, $barh, $barcolor); // send image header     header("content-type: image/png"); // send png image     imagepng($im);     imagedestroy($im);[/code] as you can see, i changed the $val and $max from $_GET vars to fixed values so I can test out how it looks and stuff.  can you recommend any help??  i also had to enable the gd2 extension in my php.ini.
  3. Thanx Barand.  I haven't given it a shot yet but NOT stringing together X amount of <img> tags is what I was looking for and it looks like PHP has a function that will generate a graph off your link with just a min/max val; thanx as always.
  4. if I have a value that I'm pulling out of a database, I'm just wondering how you'd generate a horizontal bar efficiently.  The only way I can think to do it is to echo out x amount of <img> tags calling slivers of an image.  That's a whole lot of img tags and just wanted to see if there was a better way of doing it or not?? edit:  cursory searches on google only yield 2d/3d bar graph software that you pay for.
  5. I know I could do this easily with checking a condition and then having the rest of the code only execute if that condition was true or false but I just wanted to know if there was a PHP equivalent to the VB "exit function" where it just skips code execution for that scope of code and then returns to processing like usual?? maybe something like a PHP loop continue but for functions???
  6. Sorry for the post... i figured out my problem.  In my SQL statement, I closed out my Values parenthesis but I didn't close out the one for mysql_query(
  7. [code=php:0] echo "<select name=\"fruits\">" if ($_POST['fruits']) { if ($_POST['fruits'] != 'apple') echo "<option>apple</option>"; if ($_POST['fruits'] != 'orange') echo "<option>oranges</option>"; if ($_POST['fruits'] != 'bannana') echo "<option>bannana</option>"; } else { echo "<option>apple</option>"; echo "<option>oranges</option>"; echo "<option>bannana</option>"; } echo "</select>";[/code] NOTE:  This will only work for the MOST immediately selected item.  If u want it to hold more than one item or more than one click, you'll have to add the information to a global array and then only list the items that don't exist in that array.
  8. yes... use PHP to write out the SELECT portion of your form. BUT have it check to see if a $_POST['drop_down_box_name'] exists, and if it does, use a conditional to check to see if $_POST['drop_down_box_name'] is != to whatever the dropdown box element being writting by PHP.  The logic here is that if it's been previously submitted, it'll be in the $_POST array.  Then when the page is rewritten, if u echo out every <option> of the drop-down menu but check it to see if it equals the value in $_POST['drop_down_box_name'] and if it does, it leaves that part of the code blank, it will accomplish waht you're looking for.
  9. Thank you for the oversite.  I did just copy the SQL statement from inside the mysql_query function and echo'd it just so I could make sure the vars were outputting correctly and then when I modded the password, i forgot to do it to the source. I'm familiar with making it a var but don't use it as it's an extra line of extraneous code (IMO).  The fact that I have it being echo'd means nothing; it's a string and is not interpreted as SQL unless you pass it through something like a function that's looking for SQL, it's nothing more than a bunch of characters and words strung together.  I updated the source to input the $pw1 var as md5() also.  Still not working with the same error tho....
  10. This is my snytax for my SQL Insert: [code=php:0] echo "INSERT INTO users(username,password,email,sex,city,state,country,created) VALUES('$un','".md5($pw1)."','$em1','$sex','$city','$state','$country','".strtotime("now")."')"; $query = mysql_query("INSERT INTO users(username,password,email,sex,city,state,country,created) VALUES('$un','$pw1','$em1','$sex','$city','$state','$country','".strtotime("now")."'") or die(error_handler("Error creating account information.",1,1)); db_close(); echo "Your account was successfully created.  Please log in to play! <br />";[/code] When I echo the SQL, it's something like: [code]INSERT INTO users(username,password,email,sex,city,state,country,created) VALUES('test','912ec803b2ce49e4a541068d495ab570','test@test.com','m','asdfk','asdfk','asdf','1162412485')[/code] When my script processes the code, I get this error: [quote]MySQL Error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[/quote] The funny thing is, I'm echoing out my SQL so I can see if there are any vars not being set, aren't getting \ commented, etc, etc and when I copy and paste the same SQL straight into the database through phpMyAdmin, it inserts the record correctly.  Can anyone see a problem with my syntax?? I'm at a loss...
  11. printf - sounds awesome.  where can i get it to try it out?  mjlogan - if you can find that file, i'd appreciate a link for further troubleshooting.
  12. Just as you thought, it didn't work.  Does your Spell checker have any dependencies?  Either way, do you have a site out there where I can download and test it?  and thanx again printf.
  13. i have not run the unixtodos program on these new installs and i still get the same errors.  i don't get it either printf  =/.  the only thing left i can try is to have you zip up that directory for me so i can overwrite mine if you don't mind;  it's the only thing left i haven't tried from your suggestions and those of the commentators for the pspell functions on the PHP.net site.  this is so frustrating.  if this doesn't work, i'm going to try your install on a completely seperate server and see if i can get it to work.  thanx again for all of your continued help...
  14. followed your instructions to a T and still get the following errors: [quote]Warning: pspell_new_config() [function.pspell-new-config]: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en". in E:\war\addBullets.php on line 11 Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13 Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13 Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13 Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13 Warning: pspell_check() [function.pspell-check]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 13 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in E:\war\addBullets.php on line 18[/quote] using the following code: [code=php:0]... function spell_check ( $string ) { $words = preg_split ( '/[\W]+?/', $string ); $misspelled = $return = array (); /* we use the following (2) functions instead of pspell_new() */ // reset the dictionary path, use ASpell(s) config path $config = pspell_config_create ( 'en', '', '', 'utf-8' );     $int = pspell_new_config ( $config ); foreach ( $words as $value ) { if ( ! pspell_check ( $int, $value )) { $misspelled[] = $value; } } foreach ( $misspelled as $value ) { $return[$value] = pspell_suggest ( $int, $value ); } return $return; } if (isset($_POST['submit'])) { $title = $_POST['title']; $category = $_POST['category']; $entryDate = $_POST['entryDate']; $description = $_POST['description']; $integer = $_POST['integer']; $increment = $_POST['increment']; if ($_SESSION['username'] == "my.name") { spell_check($description); iterateArray($return); exit; } ...[/code] and also [quote] Unhandled Error: C:\web\as\dict/en-only.rws: The file "C:\web\as\data/iso8859-1.dat" is not in the proper format. [/quote] when I just use pspell_config_create( "en" ) like the php site suggests...
  15. If so, if you couldn't mind compressing your Aspell directory in program files and sending it to me through one method or another, i'd greatly appreciate it.  I can't seem to get Pspell to work on my server and the only information I can find is that for Windows Servers, you either have to convert your files from Unix to Dos OR get the apsell directory files from someone on a Windows Server where Pspell is working.  My downloaded a unix2dos win32 converter and ran it against all files in my aspell\dict and aspell\data folders and i still get the same error... [quote]Warning: pspell_new_config() [function.pspell-new-config]: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en_US". in E:\war\addBullets.php on line 11[/quote] I've tried using "en", "en_US", and "en_US.multi" for this function: [code=php:0] function spell_check ( $string ) { $words = preg_split ( '/[\W]+?/', $string ); $misspelled = $return = array (); /* we use the following (2) functions instead of pspell_new() */ // reset the dictionary path, use ASpell(s) config path $config = pspell_config_create ( 'en', '', '', 'utf-8' );   $int = pspell_new_config ( $config ); foreach ( $words as $value ) { if ( ! pspell_check ( $int, $value )) { $misspelled[] = $value; } } foreach ( $misspelled as $value ) { $return[$value] = pspell_suggest ( $int, $value ); } return $return; }[/code] so... any assistance would be greatly appreciated either with suggestions on how to fix OR the source files from someone's working Aspell directory from a Windows server.
  16. don't tokenize anything.  change yoru HTML form around so you have a fname input box AND an lname input box.  That way YOU KNOW the data that's supposed to be in those boxes and can base your query off of a more structured approach.  then you change $_POST['searchBox'] to $_POST['fname'] and $_POST['lname'].
  17. for your better yet solution, you would need more information.  how are you specifying whether a market is 1/true or 0/false i'm guessing?  if you have this information in your db... the answer is simple.  create the sql statement to pull both sets of information and then from the results, format the outputting array as needed.  i.e.  = [code] while ($result = msyql_fetch_array($new_sql_statement)) {   $tempArray[$result['marketID']] = $result['market_status']; } echo "<pre>"; print_r($tempArray); echo "</pre>"; [/code]
  18. you MIGHT be able to do this in SQL, I'm not sure because i'm more versed in PHP than I am in SQL but how I would accomplish what you were looking for is leaving the query statement as is.  Write all values that you get from the SQL query to an array then run each value through a loop and a conditional to check for the specific cases you're looking for.  Unfortunately it doesn't look like your database information is standardized and becaues of it, you could get varying results.... hopefully a SQL guru will look at this and give you a much simpler solution.
  19. something like that COULD work but you're going to get a lot of responses you're not looking for if you go that route.  I've found that trying to specify a more exacting search is much easier to handle than making the most specific your query gets in the hands of the user.  =/
  20. yes, check your PHP.ini file to see where your extensions directory is pointing to and verify that it's pointing to the actual path of where your extensions are loaded in PHP, make sure that you have the mySQL extension uncommented in your PHP.ini as well.   One more thing, is 'C:\Server\PHP\ext\php_mysql.dll' a valid path?  C:\PHP\ext\php_mysql.dll is where i see most paths referenced, not usually c:\server\php\ext...
  21. [quote]Change DA in the code to whatever variable you have that holds the first two letters of each queried name. [/quote] tha'ts why you need to change "DA" in the query statement to the variable name you assign the $_POST or $_GET value passed from your HTML search form.
  22. for your search form... name your fields FIRST NAME and LAST NAME so that you have some sort of verification process for what information the user is submitting.  Then the query is very simple: $sql = "SELECT * FROM database WHERE fname LIKE '%".$_POST['fname']."%' AND lname LIKE '%".$_POST['lname']."%'";
  23. I'm pretty sure unless it's a windows box that your IIS user account has rights to (which is highly unlikely anyways), you could try to play around with [url=http://www.php.net/manual/en/ref.com.php]COM[/url].  But other than that, I'm pretty sure you'd need some custom executable that would perform some sort of RARP command to get the info it seems you're looking for.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.