Jump to content

phparray

Members
  • Posts

    96
  • Joined

  • Last visited

    Never

Everything posted by phparray

  1. Because php is processed on the server and the html entity is not be converted until it gets to the browser. html_entity_decode($row['venue'], ENT_QUOTES, "utf-8" ); works because it does the decode at the server level.
  2. This is the line causing the error. $result = $db->query($sql); $db is not defined is causing the second error Call to a member function query() That means for some $db = &new MySQL($host,$user,$pass,$name); is not being processed before $result = $db->query($sql); just make sure your call to showCart() happens after including this function file and I believe it will be ok. Something like this. require_once('performance/functions.php'); showCart();
  3. Here is a sample that works for me. I tested it successfully on php 5.2.6. <input id="venue" name="venue" type="text" /> <?php $wordArray = array('Hope','Hopeing',"Hope's"); $li = '<ul>'; foreach($wordArray as $venue) { $li .= "<li> <a href=\"#\" onclick=\"document.getElementById('venue').value = '".addslashes($venue)."'\"> $venue</a></li>"; } $li .= '</ul>'; echo ($li != '') ? $li : '' ; ?> Since the example is just using and array. If this works for you it means something weird is happening with with db output.
  4. Don't using addslashes. Use htmlentities on the way into your db and you won't have this problem at all.
  5. Looks like this could use some re-organizing. You never want to have duplicate data. This ends up making you chase your tail to keep the data identical on multiple tables. I would create tables for Manufacturers, Models, Items, Customer, Purchases - Items Manufacturers should have an id and a name Models should have an id, a foreign key referring to the Manufacturers Id, and a name Items should store each item code, unit price and have a foreign key referring to the Model Id. Customer should be all customer data like id, name, address Purchases should only be information that relates to the purchase like amount paid, data paid, and a foreign key to customer id Purchases - Items. This table would have many purchase ids and many item ids with a foreign key for each. Hopefully this will get you started. I always include fields used for reporting as well. Something like a user id so I know who modified it, date created and date modified fields so I can tell when it was created and when it changed.
  6. This is not possibly but I've seen where it could be useful. If your tables are relational you'll need to retrieve the key after the first insert then use it when inserting into the second table. Granted I'm assuming the tables are related making what I just said useful.
  7. I like Joomla too. In comparison Drupal can probably do more out of the box but it is rare you'd need all Drupal can do anyway. Sharepoint on the other hand can easily be setup on AD for internal authentication. That's not something I really looked for on Joomla or Drupal but since you mentioned using for an Intranet site it may be important. Look at all your integration points as well. Will this site interact with other internal systems? If so think about how easy it will be to do the integration. Come up with a list of requirements and build a decision matrix to help you make the best decision.
  8. Well I would start with find and replace tools. Different desktop applications come with find and replace utilities. Dreamweaver allows you to do a recursive find and replace on the sites root folder.
  9. 448191 - Very well put. I must say some of the comments left of this thread left by others have been rash and demoralizing to the self taught coders. Surprising coming from a forum dedicated to helping people learn PHP; many I'm sure who are self taught, considering PHP 101 is not a college class I've ever heard of. In my personal and professional experience I have seen many individuals both self taught and college educated. The truth in measure is who can get the job done degree or no degree. Unfortunately some employers do choose to use a degree as a filter. While most companies especially in the Web Development world will include a 4 year degree or equivalent work experience required in job ads. This is a much better approach. Someone devoted to self learning for 4 years and an equally impressive portfolio certainly is every bit as qualified for the position and deserves the same salary. Not to derail this thread any more than it has. I leave you with one last thought. The average raise is roughly 3% - 5% a year. With todays tough economic times it would not surprise me if to hear of companies putting a freeze on raises or reducing the normal increase. Consider your goal and how long it will take you to get there. Do you want to make 50K, 60, or even 80? How long should it take you to get there at 4% a year without changing jobs? How many times do you want to change jobs? If you can put some numbers to these questions and consider what others have said you will come up with the right number.
  10. You need to use clear when you want block elements to stop floating. Also using the percentages will make everything re-size per your browser size without anything additional being added.
  11. Here is another method using percentages instead of fixed widths. /* CSS file */ body { color:#fff; } #header { width:100%; height:110px; background-color:#000; margin-bottom:10px; } #content { width:50%; background-color:#000; margin-left:10%; margin-right:5%; float:left; } #menu { width:20%; background-color:#000; float:left; } .push { clear:left; } #footer { width:100%; height:85px; background-color:#000; margin-top:10px; } <!-- Html file --> <div id="header">Header</div> <div id="content">Content</div> <div id="menu">Menu</div> <div class="push"></div> <div id="footer">Footer</div>
  12. Here is a method using the mysql concat function instead of making php do it. Just change you select statement. Example: select concat(internaltool_id,externaltool_id) as ctool_id It will be put together for you in $i_row['ctool_id']
  13. My very first php application was just that, an attempt at impressing the boss by creating a solution that filled the void of a particular automated system. It was not used probably because it sucked. I'm glad I created it though. It's what got me started learning PHP and was certainly a positive worth while experience.
  14. I have to agree. You would be amazed how much more you learn by reading a good book. This one is beginners book but it will provide a good foundation. http://books.google.com/books?id=OiGO-qd06RIC&printsec=frontcover&dq=php+mysql+for+dummies If you plan on building PHP apps on a regular basis books are great!
  15. If all you want to do is display an image onchange of a select box you could use php to populate the select option values with your image file names instead of ids. Using ids would force you to use ajax but using file names would allow you to use a more dhtml approach. Of course I don't know what else you want to do with that box if you have to use ids for another reason than ajax is your friend. pseudo code for the dhtml approach js function function showImage(file,div) { var img = "<img src='/images/"+file+"' />"; document.getElementById(div).innerHTML = img; } onchange for your select tag onchange="showImage(this.value,'imageDiv')" div tag where the image will appear <div id="imageDiv"></div>
  16. First anything with e-commerce in the title should automatically up your price tag. Second I would be willing to bet you could handle it. Like other people have said there are a ton of ready made solutions which are easy enough to customize through a template system of some sort. If all they need is basic you could use paypal's tools. You wanted all the payment processing to be handled else where anyway so paypal express checkout sounds perfect. Not to mention most ready made store packages come with the paypal api built right in.
  17. Since they will not provide you with a the Job Salary for that position try searching job sites for a similar position in that area.
  18. I agree. I don't believe this is possible. Let your end users setup their browsers how they want. Open in tabs is an option in Firefox.
  19. This is a good website for comparing the cost of living between two cities. http://www.bestplaces.net/col/ If Las Vegas is higher than where you live you should ask for more. Also never sell yourself short. A self taught person must have a lot of drive and pure ability to find answers. How much you ask for is a direct reflection of your confidence. Too low is worse than too high. 45K is pretty low for a developer but ultimately you have to decide how much you think you're worth.
  20. Creating an xml file is no different than writing to any file. Just build the xml as a str and use fopen / fwrite to create the file. http://us2.php.net/fopen http://us2.php.net/manual/en/function.fwrite.php
  21. Unfortunately for commercial websites it's still important to make it at least functional in IE6. IE7 will not install on Windows XP < SP 2 and SP 2 requires hardware requirements greater than many computers in use today. Granted If it was up to myself anything that can't be upgraded to SP 2 should be sent to the recycle bin. Go Green!!
  22. Exactly - using the mysql function month() will output from a date field WITHOUT leading zeros. So using the php function date('n') will be a direct comparison to month(posted) on your table.
×
×
  • 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.