Jump to content

ethan6

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Everything posted by ethan6

  1. http://itronicsrepair.com/answers.php I would appreciate any critiques and comments, as well as "flow of ease" comments (ie. how easy it is to get register, get around, find stuff, understand how to work it, etc) It's at my iPod site here: http://itronicsrepair.com/answers.php Thank you!
  2. sorry i figured it out--- my testwysiwyg.php file didn't have a connection to the database. just needed to connect and i was good!
  3. When I try to run this code: <? session_start(); $username = "user"; $password = "pass"; $hostname = "localhost"; $database = "database"; $con = mysql_connect($hostname, $username, $password) or die("Unable to connect to database."); mysql_select_db($database, $con) or die("Could not select itroni5_cart"); $answer_a = mysql_real_escape_string($_POST['wysiwyg'],$con); $answer = nl2br($answer_a); $query="INSERT INTO answers (idquestion, username, answer) VALUES ('".$_POST['idquestion']."','".$_SESSION['username']."', '".$answer."')"; $result=mysql_query($query) or die(mysql_error()); header("Location: answers.php"); ?> I get this error: Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'user'@'localhost' (using password: NO) in /home/itroni5/public_html/testwysiwyg.php on line 4 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/itroni5/public_html/testwysiwyg.php on line 4 any ideas? Thanks!
  4. ok thanks.. i'm working with the jWYSIWYG one,. but just wondering how i add a "submit" button? thanks
  5. ok i see how the nl2br() converts \n to <br> , but what if my users just push return and don't enter code in? is there a way i can get a WYSIWYG editor so the people entering it don't have to enter code? thanks!
  6. ok thanks. how about formatting of the data that they enter? When i output it, i'd like it to preserve their paragraphs etc.
  7. Well see that's what I have, but then when I go to output the data that is saved in my database, any odd characters get all messed up.. or when they're entering data, if the user enters an ' (apostrophy) for example, it gives an error.
  8. Like this text box I'm writing in right now-- what should I use for users on my website to enter text on a forum on my website? I'm writing in PHP, and my database is in SQL. Thank you
  9. sorry that one link didn't work.. you can view the parts/cart here: http://itronicsrepair.com/parts.php http://itronicsrepair.com/cart.php
  10. Hello, I have a simple shopping cart in php and I have it set that when the user wants, they can click checkout and it brings them to paypal to pay. Unfortunately, I can't seem to get all the variables to output in the "items" line, i can only get the last item in the cart (I think it's like in an array?) Here's the code of the function showCart() that has the button to click on to go to paypal at the bottom: function showCart() { global $db; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $output[] = '<form action="cart.php?action=update" method="post" id="cart">'; $output[] = '<table>'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM parts WHERE id = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $output[] = '<tr>'; $output[] = '<td><a href="cart.php?action=delete&id='.$id.'" class="r">Remove</a></td>'; $output[] = '<td>'.$part.'</td>'; $output[] = '<td>&#36;'.$price.'</td>'; $output[] = '<td><input type="text" name="qty'.$id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; $output[] = '<td>&#36;'.($price * $qty).'</td>'; $total += $price * $qty; $output[] = '</tr>'; } $output[] = '</table>'; $output[] = '<p>Grand total: <strong>&#36;'.$total.'</strong></p>'; $output[] = '<div><button type="submit">Update cart</button></div>'; $output[] = '</form><br>'; $output[] = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">'; $output[] = '<input type="hidden" name="cmd" value="_xclick">'; $output[] = '<input type="hidden" name="business" value="Service@iTronicsRepair.com">'; $output[] = '<input type="hidden" name="item_name" value="'.$part.'">'; $output[] = '<input type="hidden" name="item_number" value="'.$id.'">'; $output[] = '<input type="hidden" name="amount" value="'.$total.'">'; $output[] = '<input type="hidden" name="shipping" value="2.99">'; $output[] = '<input type="hidden" name="no_shipping" value="2">'; $output[] = '<input type="hidden" name="return" value="http://itronicsrepair.com/thankyou_order.php">'; $output[] = '<input type="hidden" name="cancel_return" value="http://itronicsrepair.com/cancel_order.php">'; $output[] = '<input type="hidden" name="currency_code" value="USD">'; $output[] = '<input type="hidden" name="tax" value="0.00">'; $output[] = '<input type="hidden" name="lc" value="US">'; $output[] = '<input type="hidden" name="bn" value="PP-BuyNowBF">'; $output[] = '<input type="image" src="http://itronicsrepair.com/img/checkout.jpg" border="0" name="submit" alt="Make payments with PayPal - it is fast, free and secure!">'; $output[] = '<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">'; $output[] = '</form>'; } else { $output[] = '<p>You shopping cart is empty.</p>'; } return join('',$output); } ?> It is this line above where I want to output every part id#, not just the last one in the list: $output[] = '<input type="hidden" name="item_name" value="'.$part.'">'; Any thoughts? thanks. oh if you want to view the cart, it is at http://itronicsrepiar.com/parts.php .. put something in the cart and then it brings you to http://itronicsrepair.com/cart.php thanks.
  11. yeah i don't think i'd use frames. what are other people seeing for speed of my website in both initial loading time as well as moving between pages? again, it's at: http://itronicsrepair.com Thanks!
  12. Ok I've now added lots more.. content etc. Let me know what you think, thanks!
  13. anyone? i know it's a rough start, but any suggestions, good or bad? thanks!
  14. ok i tried your login and it works BUT: i would highly suggest moving to an all-PHP site. You need to use something so it remembers i just logged in, otherwise when i click on home, i get "logged out".. i'd suggest maybe PHP $_SESSION variables (http://w3schools.com/php/php_sessions.asp) to remember you're logged in.
  15. it's not something you can just copy and paste.. it's a more complicated process and i'd suggest learning whatever you decide to use. Here's an outline of what you'll need to know: registration page: -create database (probably in PHP MyAdmin or similar) -create table for users in SQL -connect to database on page -PHP registration script on page that creates a new row in table "users" profile page: -connect to database -display user's data (accessing it from table in database) -use an html <form> to input data-- and then use PHP/SQL to Insert/Update this data in database -re-display updated data. Search google if you want a more in depth tutorial, but you're going to have to learn some PHP and SQL for this to work.
  16. could you provide a test user name and password so i can take a look at your logged-in site? thanks.
  17. The best reference I know of for an introduction into PHP and MySQL is at http://w3schools.com
  18. ok so are you pasting that include code, editing the name of your file location, and it's not showing anything at all? also, is the file that you're putting it into a php file (ie. ends in .php)? creating profiles etc can become complicated, what you will probably need to learn is SQL if you haven't already. In order to "create a profile, edit, update" etc, you will need a DATABASE. Then using PHP, you will have the user access the database to update his/her information, and then it will save the changes on your server. without this kind of database, it's impossible to store the user's information so he/she can come back to it later.
  19. well, i'm pretty sure you would need to switch your site over php (ie. index.php not index.html if that's what you have). once you do that, you can just "include" the login page right in the html like this. ...first part of html site here... <?php include("register_page.php"); ?> ..rest of html here...
  20. no i haven't registered, i would suggest most information is available without registering if possible. also, i see the registration is a separate window, i would suggest integrating it into the actual site layout.
  21. ok, imo the first thing i noticed is that the logo is WAY too tall.. you could do with 100 or 150 px just fine, it takes up way to much of my screen, and i lose out seeing more info on the site. i do like the "feel" of the site, very modern. note: Extras doesn't have an apostrophe (not "Extra's"). i'd also agree that you should just have links that say "Register" or "Login" instead of the "Why not register with us?" or what you have.
  22. hello, i am developing an "answer database" that users can submit their feedback (thumbs up or down) on the success of the answers. it's still rough draft form, but any suggestions would be helpful, thanks! it's at: http://itronicsrepair.com/answers.php Thanks!
×
×
  • 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.