Jump to content

DarkSuperHero

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by DarkSuperHero

  1. yeah sounds like you migth want to checkout the basic's tutorial on SQL syntax for inserting/updating/deleting data from a database from http://www.w3schools.com/sql/default.asp ....I find that to be a great resource for learning SQL.... after which data normalization would probably be the best way to handle your database..... How good are you with php ? for tutorials on the more basic concepts phpbuddy.com is great.... Cheers!
  2. I think a step into the right direction might be to look into Database Normalization: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html unfortunatly I dont know of a project you can base yours off..but sounds like your being proactive...what are your current plans...what concepts have you loooked into ??
  3. Heres a quick tutotial on doing just that... ;-) http://www.barelyfitz.com/projects/csscolor/
  4. i found this simple PHP DOM parser... looks promising...looks like you could def use this... http://simplehtmldom.sourceforge.net/
  5. $full_path_to_public_program = $_SERVER['DOCUMENT_ROOT']."/classifieds"; yes looks like there's an extra path separator ( / ) try removing it... $full_path_to_public_program = $_SERVER['DOCUMENT_ROOT']."classifieds";
  6. im sure this wont make much of a diff...but try.... <?php mysql_query("INSERT INTO table (`hash_key`, `inv_key`, `to`, `date`, `due_date`, `inv_number`, `ref`, `tax_incl`) VALUES ('$hk', '$ik', '$to', '$date', '$due', '$inv_num', '$ref', '$tax')") or die(mysql_error()); ?> and your sure that your the table is named table, and it has the columns named: hash_key, inv_key, to, date, due_date, inv_number, ref, tax_incl ?
  7. try changing <?php //... require("$full_path_to_public_program/$language.php"); //... to <?php //.. require("$full_path_to_public_program/Scripts/$language.php"); //... near the end of the script you posted...
  8. what are some of the values you are trying to inser...what does $ik, $to, $date look like ?
  9. KEN 2k7 is right! You need to use those blasted code tags...and not color your code...makes me not even want to try... but look like you dont have a file named end.php ... are you keeping this file relative to where it supposed to? Make sure all files are where there supposed to be all the error is really saying.... do y ou have an eng.php file in your classifies foldeR? And would this technically be in violation of "This file may not be redistributed in whole or significant part." and also this might be the wrong forum since this is a 3rd party script... CheerS!
  10. I am having a heck of a time but I need help getting the newest version of the Zend Framework to hook up into Zend Studio...I am just begining to use the Zend Framework for the first time....how would I go about making it an option in the new Zend Project Dialog... ? heres a screen capture... I have Zend Studio 6.1
  11. the standard php library has an XMLWriter class that makes generating XML a breeze...and SimpleXML class makes readin XML a breeze as well...Im sure you can find a tutorial online that makes use of these... :-) Overview of both: http://devzone.zend.com/article/2387 quick google search gave me this... looks promising, looks like instead of printing the result you could write it to a file... :-) http://simonwillison.net/2003/Apr/29/xmlWriter/ <- not to be confused with Official XMLWrited class
  12. well, depends where your headed with php.... if you plan on using a framework, they pro'lly have a directory structure in place.... but it really is up to you and how you want to handle your directories...all that matters is that you are aware of your stucture and use it appropriatly I believe...:-) Zend Coding Standard: http://framework.zend.com/manual/en/coding-standard.html PEAR coding Standards: http://pear.php.net/manual/en/standards.php
  13. im not entirely sure because I've never used it but, shouldnt the SQL Query be something more along the lines of <?php //..... $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_news WHERE id='".$cat_id."'"),0); //......
  14. looks like there might be other code that generates this... you posted this for your code.. <table width="40%" height="49" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><img src=" imagesArt/sml_550135135.jpg" name="" border="0" /></td> </tr> <tr> <td valign="top"><p align="center"><strong>Item# 570<br /> AUTHENTIC COACH WRISTLET NEW WITHOUT TAGS</strong><br /> <br /> <strong>PRICE:</strong> <span class="style3">20.00</span><br /> <strong>SHIPPING:</strong> <span class="style1">$4.00</span><br /> <span class="registrationMark"> <form action='https://www.paypal.com/cgi-bin/webscr' method='post'> <div align='center'> <input type='hidden' name='cmd' value='_xclick' /> <input type='hidden' name='business' value='bizname' /> <input type='hidden' name='item_name' value='AUTHENTIC COACH WRISTLET NEW WITHOUT TAGS' /> <input type='hidden' name='item_number' value='570' /> <input type='hidden' name='amount' value='20.00' /> <input type='hidden' name='shipping' value='4.00' /> <input type='hidden' name='return' value='completed.php' /> <input type='hidden' name='cancel_return' value='cancelled.php' /> <input type='hidden' name='no_note' value='1' /> <input type='hidden' name='currency_code' value='USD' /> <input type='hidden' name='bn' value='PP-BuyNowBF' /> <span class='style21 style9 style10'><strong> <br /> <input type='image' src='https://www.paypal.com/en_US/i/btn/x-click-but23.gif' border='0' name='submit' /> </strong></span><br /> </div> </form> Coach wool wristlet complete with hanging Coach fab. New without tag. 7 ¾ inches wide x 4 inches in height.<br /> <br /> </span> </p></td> </tr> </table> but your source has more html generated than the code you posted...leading me to believe that the code in question is wrapped in some other code...either by includes...or directly....is there any more code associated with the page in question ?
  15. <html> <head> <title></title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="trig"> <option value="sin">Sin ( )</option> <option value="cos">Cos ( )</option> <option value="tan">Tan ( )</option> </select> <select name="deg_rad"> <option value="rad">Radians</option> <option value="deg">Degrees</option> </select> <input type="text" name="trig_value"> <input type="submit" value="Solve"> </form> <?php $find_trig = $_POST['trig']; $deg_rad = $_POST['deg_rad']; $trig_value = ($_POST['deg_rad'] == 'rad')? $_POST['trig_value'] : deg2rad($_POST['trig_value']); if($find_trig == 'sin') { echo (sin($trig_value)); } else if($find_trig == 'tan'){ echo (tan($trig_value)); } else if($find_trig == 'cos'){ echo (cos($trig_value)); } ?> </body> </html> try that...
  16. ive attempted to run a website that had a gallery with thumbnails that were generated on the fly...to say the least my account got suspended on my shared host, and I needed to find another solution...so if your on shared hosting It would probably upset your host some if you were using such resources wastefully....also your website would load slower with on the fly thumbnails... especially if your displaying many many images...
  17. how about posting the information into a flat file, and reading/writing to it evertime the page is accessed...any data that is older than say 5 minutes is deleted....using the time() which would be the number of seconds since the beginning of the internet epoch eg flatfile: botName:visitedOn googleBot:1002326265626295635659 askJeevesBot:1002326265626295636556 //read using file(); which gets each line of file into an array element //iterate through elements and explode() them at separator...compare....if the bot that is accessing the file does not match one add an array element...else update the array's time then write the elements of your updated array into the textfile.... you would then echo which bots are currently online by looking at the flat file
  18. While reading one the books I purchased on php to illustrate a point on the Factory Patter, they decided to go about building a class to handle different database connections regardless of what database it was...how about looking into the Factory patter to do this...I have not had a try since I mostly just use MySQL.... Here's some reading on the subject... http://www.devshed.com/c/a/PHP/The-Basics-of-Using-the-Factory-Pattern-in-PHP-5/
  19. from the code in the original post it looks like your trying to use php & javascript .....does your code still look like this? <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="fan" id="fan"> <input name="yourfan" type="image" value="Submit" onClick="<?php if(isset($_POST['yourfan'])) { $to = $row_Bus['Email']; $subject = 'You Have A Fan !'; $body = "blah...blah...blah.... "; $headers = "From: admin@mysite.com\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1 \n"; $mail_sent = mail( $to, $subject, $body, $headers ); }//nothing echos inside your php....just a note... :-P ?>MM_popupMsg('It\'s official! You are now a fan.')" src="/FANBUT2.png" alt="Become A Fan"/> </label> <input type="hidden" name="MM_insert" value="fan" /> </form> to make it more readable do this... <?php if(isset($_POST['yourfan'])) { $to = $row_Bus['Email']; $subject = 'You Have A Fan !'; $body = "blah...blah...blah.... "; $headers = "From: admin@mysite.com\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1 \n"; $mail_sent = mail( $to, $subject, $body, $headers ); }//nothing echos inside your php....just a note... :-P ?> <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="fan" id="fan"> <input name="yourfan" type="image" value="Submit" onClick="MM_popupMsg('It\'s official! You are now a fan.')" src="/FANBUT2.png" alt="Become A Fan"/> </label> <input type="hidden" name="MM_insert" value="fan" /> </form>
  20. it should be as simple as: <?php echo('<b><span style="color:#FF0000;"'>$_SESSION['disp_msg'][0]'</span></b>'); although, it looks like the function just sets up some information in the sessions variable...the way you would output the information in the sessions variabels would be independent of the function itself.....I think you might be after something else rather than this function....and I don't think "else if" statements are needed here...
  21. i would suggest file() to get the files information into an array...if that was all that was in your file...you would have <?php $fileName = 'somefile.ini'; $myInfo = file($fileName); print_r($myInfo); //prints readable array of file info....eg.. /* [0] = 'Name = Example;' [1] = 'Age = 33;' [2] = 'School = University;' [3] = 'Address = Japan;' [4] = 'Phone = 0123-14544521;' */ then to edit the information you just use any applicable series of string functions like preg replace, or strstr...or just flat out replace the array value at what ever point...then to rewrite the data back onto the file just iterate through your array and use the fwrite function... :-) http://us.php.net/file http://us.php.net/fwrite http://us.php.net/manual/en/function.preg-replace.php
  22. I would say flash would be most versitile....and its on the largest number of user computers... :-)
  23. i think you might be needing hexdec() - http://us.php.net/manual/en/function.hexdec.php .... PS- Maybe not... :-\
  24. if it works fine with certain code try this.... <?php if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . time() . $_FILES['Filedata']['name']; // Uncomment the following line if you want to make the directory if it doesn't exist // mkdir(str_replace('//','/',$targetPath), 0755, true); move_uploaded_file($tempFile,$targetFile); } echo '1'; ?> i time() to the file name which will always be different, since its seconds elapsed since the "beginning of time".
  25. i found this tutorial doing a quick google search http://www.phpeasystep.com/phptu/2.html
×
×
  • 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.