Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. You need to print more table rows. echo "<table><tr> <td class="tableCellOne"> </td></tr> <tr><td class="tableCellOne">Description</td></tr> <tr><td class="tableCellOne"> <?php echo str_replace("<p>"," ",$sql_project_fetch_array['description']); ?></td> </tr> Denno
  2. Try this code. It doesn't complain about any syntax errors. <?php $confirmCode = md5(uniqid(rand())); $to = $_POST; $subject = "Subject"; $message = " To confirm that registration, please click on this link: [url=http://www.pinoyescrow.com/confirmation.php?passkey=]http://www.pinoyescrow.com/confirmation.php?passkey=[/url]$confirmCode$headers = \'From: [email]admin@mysite.com\'" . "\r\n" . 'Reply-To: admin@mysite.com' . "\r\n" . mail($to, $subject, $message, $headers); ?> I looked up the different between single and double quotes, and turns out it's personal preference. However, if you use double quotes, you need to escape any single qutoes (by putting a \ before it). It basically says, treat the next character as if it were just a normal character, don't give it any special meaning. Hope that helps. Denno
  3. does the $headers variable display properly in your emails? I've copied your code into dreamweaver, and it's immediately complained, saying there is syntax errors. Attached is a screenshot, so you can see where these are, and how my auto formatting is showing the code. What do you code your php in? Denno [attachment deleted by admin]
  4. I'm with JustHost for the web hosting.. I'm not sure about the ins and outs with their SSL and receiving POST data.. I'm actually creating this website for a client, so this is the host that they've got. And thankyou harristweed, I'm pretty sure I already said that I have changed the POST destination.. The weird thing is, when I first set up the button, I put it with a price of $0.01, and made a payment using my paypal account (a normal buyers account), and the IPN worked fine. I then changed the price to the correct amount, and the 5 payments that have occurred since then, the IPN didn't work properly. I set up another button with a price of $0.01 on a different page in the site, and tested it again myself, and again, it worked perfectly. So I don't know why it would work perfectly when I'm paying, but not when other people are paying? Denno
  5. Pretty much exactly lol. If the username is not found in the session, or if the username that is found, is wrong, then the log in form is shown, and the rest of the page processing is stopped. More than happy to help, hopefully you find it useful. Denno
  6. In the code I provided, if admin has successfully logged in, then pretty much nothing happens... The contents of index is shown as intended.. The second if statement in admin_check will check if the username set in the session is the correct one, and if it is, it will skip the if and continue processing the page (in this case, it would be the rest of the index page, as admin_check was included into it). Not sure if that makes sense? Denno
  7. Check this out. This is the edit page that you'll learn to create in those videos. It queries the database, and then fills the form with the data from the db, which can then be changed, and resubmitted. There is also javascript to make sure there isn't any empty fields when the form is submitted. <?php session_start(); include_once "admin_check.php"; ?> <?php //Add an if statement here to check if the requested pageID is valid. $pageID = ereg_replace("[^0-9]", "", $_POST['pageNumber']); //filter everything but numbers for security //Query the body section for the proper page include_once "../scripts/connect_to_mysql.php"; $sqlCommand = "SELECT pagetitle, linklabel, pagebody FROM pages WHERE id='$pageID' LIMIT 1"; $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); while ($row = mysqli_fetch_array($query)) { $pagetitle = $row["pagetitle"]; $linkLabel = $row["linklabel"]; $pageBody = $row["pagebody"]; $pageBody = str_replace("<br />", "", $pageBody); } mysqli_free_result($query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Editing Page</title> <!--The following script/s are used for TinyMCE --> <script type="text/javascript" src="../scripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ theme : "advanced", mode : "textareas", plugins : "fullpage", theme_advanced_buttons3_add : "fullpage" }); </script> <!-- End of TinyMCE scripting --> <script type="text/javascript"> function validate_form(){ valid = true; if(document.form.pageTitle.value == ""){ alert("Please enter the page title."); valid = false; }else if(document.form.linkLabel.value == ""){ alert("Please enter the link label"); valid = false; }else if(document.form.pageBody.value == ""){ alert("Please enter a page body"); valid = false; } return valid; } </script> </head> <body> <p>Be sure to fill in all fields, as they're all required.</p> <form id="form" name="form" method="post" action="page_edit_parse.php" onsubmit="return validate_form();"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="300" align="right">Page Full Title</td> <td><label for="pageTitle"></label> <input name="pageTitle" type="text" id="pageTitle" size="150" value="<?php echo $pagetitle ?>" /></td> </tr> <tr> <td align="right">Link Label</td> <td><label for="linkLabel"></label> <input name="linkLabel" type="text" id="linkLabel" size="30" value="<?php echo $linkLabel ?>" /></td> </tr> <tr> <td align="right" valign="top">Page Body</td> <td><label for="pageBody"></label> <textarea name="pageBody" id="pageBody" cols="150" rows="8" value="<?php echo $pageBody ?>"></textarea></td> </tr> <tr> <td align="right"> </td> <td> <input name="pageID" type="hidden" value="<?php echo $pageID ?>"/> <input type="submit" name="submitPage" id="submitPage" value="Create Page Now" /></td> </tr> </table> </form> <p> </p> </body> </html> This is the code that is run when the form is submitted (the changes are submitted). This contains the update functionality that you will be interested in <?php $pageID = $_POST['pageID']; $pageTitle = $_POST['pageTitle']; $linkLabel = $_POST['linkLabel']; $pageBody = $_POST['pageBody']; //Filter Function ========================================================================= function filterFunction($var){ $var = nl2br(htmlspecialchars($var)); $var = eregi_replace("'","&#39;",$var); $var = eregi_replace("`","&#39;",$var); return $var; } $pageTitle = filterFunction($pageTitle); $linkLabel = filterFunction($linkLabel); $pageBody = filterFunction($pageBody); //End Filter Function ===================================================================== include_once "../scripts/connect_to_mysql.php"; //Add the info into the database table $query = mysqli_query($myConnection, "UPDATE pages SET pageTitle='$pageTitle',linkLabel='$linkLabel',pageBody='$pageBody', lastmodified ='now()' WHERE id='$pageID'") or die (mysqli_error($myConnection)); echo 'Operation Completed Successfully! <br/><br/><a href="index.php">Click Here</a>'; exit(); ?> N.B. The code above, while I typed it myself, it was based directly of the code in the videos from flashbuilding, so it's not my code, I merely understand it. Sorry that I am unable to read your code and understand it completely, hopefully you'll be able to model your efforts on these working files that I have provided though . Denno
  8. This is how I would approach your problem, it might not be the right way, or the most efficient way, but it will be a start: Make each square a submit button for a form. Add onSubmit to each of the forms, but no action. Your onSubmit will call a function that will change the background colour of the square. You will need to google: How to make an image a submit button for a form. How to use the onSubmit functionality of a form. How to change the colour of a div using javascript (assuming the squares are divs, either way, you need to research how to change something using javascript). That should just about get you what you want.. Denno
  9. Fairly sure you're creating yourself a CMS? I would suggest watching these youtube videos, I had no idea about how to use php AT ALL, before I watched them. They're made by youtube user flashbuilding. This isn't some sort of marketing crap for him, I genuinely learnt my php from his videos . Hopefully that link will take you to the first video in the playlist. You can then work your way through there. Videos are lengthy, but they're so worth it . Denno
  10. Alright well if you're happy to re-work what you've already got, and start again, here is some code that I've been using, and it works nicely. I've got the user name and password 'hard coded', but I'm sure you can alter this to access a db, and do all your filtering on the email. index.php <?php session_start(); include_once "admin_check.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </script> </head> <body> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td></td> </tr> <tr> <td>Show member information here</td> </tr> </table> <p> </p> </body> </html> admin_check.php <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td>Login Form</td> <td><a href="index.php">Admin Home</a></td> <td><a href="../index.php">View Live Website</a></td> </tr> </table> <?php $error_msg=""; if($_POST['username']){ $username = $_POST['admin']; $password = $_POST['password']; //Simple hard coded values for the correct username and password $admin = "adminUser"; $adminpass = "password123"; if(($username != $admin) || ($password != $adminpass)){ $error_msg = ': <font color="FF0000">Your login information is incorrect</font>'; }else{ session_register('admin'); $_SESSION['admin'] = $username; require_once "index.php"; exit(); } } ?> <?php if($_SESSION['admin'] != "adminUser"){ echo '<h3>Only the administrator can view this directory</h3><br/> <table width="340" border="0" cellspacing="1" cellpadding="1"> <form action="admin_check.php" method="post" target="_self"> <tr> <td><table width="340" border="0" cellspacing="1" cellpadding="1"> <tr> <td colspan="2">Please Log In Here' . $error_msg . '</td> </tr> <tr> <td width = "111">Username:</td> <td width = "219"><label for="textfield"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td>Password:</td> <td> <input type="password" name="password" id="password"/></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="submit" id="submit" value="LogIn" /></td> </tr> </table></td> </tr> </form> </table> <a href="../">Click here to head back to the homepage</a>'; exit(); } ?> Obviously, you're not doing an admin check, but it's the same principal, having a login. If you can't follow anything above, let me know and I'll try and explain it in detail . Denno
  11. Doesn't make a difference? Denno
  12. Ok cool. Wasn't sure if I was making it easy to understand or not, but I'm glad it was . Denno
  13. Yeah you would usually use it for javascript. Denno
  14. Is session_start() the very first thing that is read? In your second post you say "there is other html code that does nothing really". I'm pretty sure that you need to have session_start() as the very first thing that is executed/read. Try that? Denno
  15. I'm not sure the name of the symbol that you have used as the name of that function, but it appears that you've then called it a lol. Anyways, yes, wherever you call a(); foo will be echoed. I guess, in a way, it's almost like an include.. Replacing a(); with echo 'foo'; whereever a() is written. I wouldn't think of functions as variables though. Think of them as blocks of code that will acheive a similar goal (usually indicated by the name of the function). So for example, your function should have been called printFoo() Whenever you call printFoo(), foo will be printed to the browser.. Making more sense? Denno
  16. You need to have your background set to be a repeating image. From the looks of it, you've got one image that takes up the space, and therefore won't shrink down.. You basically need one wrapper around your main content (your main content being an imaginary box from the top left of A1 Quality Corp logo, to the bottom right of mach distribution), this will automatically resize itself to the right height, but you need to make it's width me 100%. You then need to apply a repeating image as a background to that wrapper. This will ensure that when the browser window resizes, the wrapper div will get smaller, and therefore the number of background repeats required will be less. The main content will keep it's form (providing you've given it a set width). It's hard to explain without literally sitting there with you and pointing to the different features.. but I hope you understand somewhat.. Denno
  17. As a really quick suggestion, have you tried omitting the $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); Maybe one of them is taking out the @ symbol and therefore making the email address incorrect? (I'm not too familiar with how those functions work, but this is what I would do if I were testing your code). Where do you actually display $toplinks? I can't see it echoed anywhere.. Isn't it supposed to be? Denno
  18. Without looking through all of that code, as there is alot, I would just have a guess at, have you put the script information on every page? And have you fixed the paths so they're still pointing to the scripts location? If your sub-pages are in a different directory to your index page, then you will need to modify the path to the Colorbox script. That's all I would imagine could stop it from working.. Denno
  19. http://dynamicdrive.com/dynamicindex2/index.html Denno
  20. php code that you have so far? Will help greatly in understanding the problem and helping to find a solution Denno
  21. It's normally written as function foo(){ } You use the parenthesis to pass variables into the function, so if you have a function to count something, you might pass a variable that represents the maximum count, so the function will be finished when this value is reached. Functions need to be called, they won't just run. That's a pretty basic explanation. Denno
  22. You probably want to add an onSubmit function that will check how many coins they have, and if they still have 50 in the database, they will be able to purchase the flower. Otherwise, you will show a message saying they don't have enough coins. (The form action won't run if the onSubmit function returns invalid - or something like that. Best to google it ) Hope that helps Denno
  23. What is your php code that you're using to get that data from your db and print it? Denno
  24. I think you have something funky going on with your " " and ' '. Might want to look at them. Also check if you need to do anything special around $confirmCode, might need some " " or ' '. Just google: inserting php variables into an email Work from there, you should be able to find heaps of information. And if you find it yourself, you will learn it alot better than pulling the answer from someone here . Post back if you're still having problems. Denno
  25. Thanks for the reply kirkh34.. Still doesn't work for me though.. Could I possible see your IPN file? Did you write your own, or did you use the sample code from PayPal? Denno
×
×
  • 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.