Jump to content

drisate

Members
  • Posts

    805
  • Joined

  • Last visited

Everything posted by drisate

  1. Theres no build in fonction to turn a number into an alpha number ... so your gona have to make a function and a loop <?php function alpha($nb) { if ($nb=="1"){return "One";} [..] } $i = 1; while ($i <= 50) { echo alpha($i++); } ?>
  2. no that only works to rebuild html out of strings passed into htmlentities() this <b>bold</b> would get back to <b>bold</b> using the function i gave you.
  3. yes you can use vars from your url Let say you have mysitedotcom/mypage.php?id=1 To get the var id you would use $_GET[id] PHP auto produces it when you open mypage.php so if you make <?php echo $_GET[id]; ?> at the bigining of your page you would have the value 1 printed on the page. You can also use that var in your sql statment SELECT * FROM table WHERE id='$_GET[id]' but of couse don't forget to clean the var to protect you self aganst hackers that could change the the value 1 to malicious codes and manipulate the querry.
  4. this echo "$getlink is really = to $link"; befor this if ($getlink == $link) { A possible problems could be that $getlink is not = to $link so the update never happens. It's hard to find resons of what can cause your problem since all you told us is it's not working ...
  5. can you add this and tel me what you get echo "$getlink is really = to $link"; put it before if ($getlink == $link) {
  6. thats because you missing a where to the query select * from products where id='$id' or something like that to point the row you wana show
  7. yeah you put your code of what to do if true and finish with what to do if false. Much better then exit();
  8. if puting it out of the <a> did'int work it probably meand your class="' . $css_class . '" was taking care of the formating. you could of just edit the css
  9. oh then just place it in lol <?php $output .= $indent . '<li class="' . $css_class . '"><b><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a></b>'; ?>
  10. you can try it the other way if (user_account($first_name,$last_name,$email)){ // is true // bla bla bla ... }else{ // is false echo 'A system error occurred.Please contact eBooks4U '; } so that way you probably don't need the exit(); anymore
  11. theres probably a loop or something ... use this after or before $output .= '<li><a href="http://www.web-blogs.co.uk/"><b>Home</b></a></li>';
  12. yeah i guess lol maby for an other rev Sorry bro i am not gona do it for you. Theres more benefit in showing how to fish then giving a fish. Your gona have to try the sugestions and ask questions as you block
  13. try this if (!user_account($first_name,$last_name,$email)){ echo 'A system error occurred.Please contact eBooks4U '; exit(); }
  14. Yeah well if you have more then one row to check you need to use a loop so i guess this would be best <?php $re = mysql_query("select * from products") or die (mysql_error()); if (mysql_num_rows($re)) { while ($products_info = mysql_fetch_array($re)) { if ($products_info['supplier']=='1') { $lc_text = '<a &#160;href="some url"</a>' ; }else{ $lc_text = '<a href="some url" </a>' ; } } } ?>
  15. All my tables are css styled and it's not a Modified bulletin board it my bulletin board lol No idea how much it slows the website down but i do beleave keeping the formating in css the most you can will reduce the page html output and result in a faster indexion by the webspiders. Anyway, i always coded like that and use divs in rare occasions. is that bad? lol as long as we take the time to read and help others lol
  16. Hows the %postid% difined? can you post all therelated code?
  17. hehe i almost never use div's but yet my stuff is not that basic http://versatilebb.com/demo/
  18. the $supplier var takes the value from the table you should look in phpmyadmin if the var is 1 or 0 abbout the slowing i don't think it's the if ... would probably come from my extreamly lazy string lol $supplier = @current(@mysql_fetch_assoc(@mysql_query("select supplier from products")));
  19. in my opinion tables are alot more easy to work with when it gets to the structure of the website. Div's are way to much volatil. I find it bad coding to use only div's on a web display.
  20. i think i prefer the good old ways lol '..' breaks the ' string and every php editors colors the var out for easy finding. Just my opinion.
  21. And to optimize it you can also do this: <?php $supplier = @current(@mysql_fetch_assoc(@mysql_query("select supplier from products"))); if ($supplier=='1') { $lc_text = '<a &#160;href="some url"</a>' ; }else{ $lc_text = '<a href="some url" </a>' ; } ?>
  22. just use the code i posted lol try it. i am positive that will work
  23. just to be sure are you doing them in order? <?php $re = mysql_query("select * from products") or die (mysql_error()); if (mysql_num_rows($re)) { while ($products_info = mysql_fetch_array($re)) { if ($products_info['supplier']=='1') { $lc_text = '<a href="some url"</a>' ; }else{ $lc_text = '<a href="some url" </a>' ; } } } ?> Because if your doing mysql_fetch_array at the end of the page the start of it will not have the vars created
  24. You can find a solution in this topic http://www.phpfreaks.com/forums/index.php/topic,183741.0.html Hey Barand you should stiky a version on that code roopurt18 did lol (gona ask again and again lol)
  25. wow looks nice :-) You should put up live exemples to play with. I never toutched ajax yet ... lol i always managed with out it ... in this case JS would be great and easy but ajax gets more popular everyday. I am gona have to learn it soon. >.<
×
×
  • 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.