Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. create another table with clientName and passWord fields. Have the user log in. Once logged in, use the clientName in a simple query to the projects table, and echo the rows in the result.
  2. is the table in a mysql database? You want us to make up a simple query for you? This is the basics of php/MySQL.
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>All lines imported and shown "pre" style</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body> <div> <?php //this gets all the lines of a file and outputs as code like <pre> of html $lines = file('http://www.openwebdesign.org'); foreach ($lines as $line_num => $line) { echo str_replace(" "," ",htmlentities($line)) . "<br />\n"; } ?> </div> </body> </html>
  4. There's absolutely nothing wrong with php pages being indexed by Google. I have many many pages that are indexed by Google that are php.
  5. You need to validate all POST or GET variables as they come into your php programs. You can do this with regular expressions. Modifications to the variables isn't exclusive to the program you linked us to. It's easy to do it by hand.
  6. I believe that you would just have to use the same session or cookie to stay logged in. You might go to their message board to ask about it. I used to have a phpBB forum and know that the forum help support is very nice.
  7. This might work for you: <?php $url = "removejs.htm"; $input = @file_get_contents($url) or die('Could not access file: $url'); $regexp = "(.*)<script(.*)<\/script>(.*)"; if(preg_match_all("/$regexp/si", $input, $matches)) { echo $matches[1][0]; echo $matches[3][0]; unset($matches[1][0]); unset($matches[2][0]); unset($matches[3][0]); } ?> I forgot the while loop for multiple instances, but wouldn't be hard to do
  8. I use an email processing script that as a side process uses curl to add people to an email list. This side process is independent of the email processing script, and once both tasks have been completed the main script redirects the user to either a thank you page, a thank you page with email list confirmation, or an error page. This is the side process that uses curl: <?php if ($aCleanedValues['opt-in'] == 'Y'){ $prename = $_POST['realname']; $nameRegex = "/^[A-Z\s\.,'-]+$/i"; $preemail = $_POST['email']; $emailRegex = "/^(?:^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|gov|mobi|tv|biz|info|jobs|museum)$)$/i"; if(preg_match($nameRegex,$prename) && preg_match($emailRegex,$preemail)) { $name = $prename; $email = $preemail; $url = "http://newsletters.somedomain.com/subscribe.aspx?Task=Join"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); // set url to post to curl_setopt($ch, CURLOPT_FAILONERROR, 1); //needed for some reason curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //so you dont see the process, it just happens before the redirect curl_setopt($ch, CURLOPT_POST, 1); // set POST method curl_setopt($ch, CURLOPT_POSTFIELDS, array('Name'=>"$name", 'Email'=>"$email", 'DeliveryFormat'=>'HTML', 'Password'=>'RandomNumber', 'NewsletterListID'=>'526', 'JoinType'=>'Menu', 'SID'=>'{abcEB2A7-0B0C-A50B-ckjkaddB114A}')); // add POST fields curl_exec($ch); // run the whole process curl_close($ch); } } ?>
  9. It kind of defeats the purpose of a watermark to have it on the edge. If somebody steals your image and crops it, they basically have the regular image. Ideally the watermark goes right through the focal point of the image.
  10. Something like this: $sql = mysql_query("SELECT * FROM table WHERE type = 'stinky'") ; while ($row = mysql_fetch_array($sql)){ extract ($row); echo "<strong>$name</strong>"; }
  11. if you need more of your rows to print, then you have to loop through the results of your query.
  12. First you have to connect to the database, then you have to query the database and retrieve the data, then you insert the data into your textarea. You need a database connection script and query first.
  13. From my curl posting experience, I don't think it's possible for you to see the url of the script processing the post variables. If you hadn't set return transfer then you would have been redirected, and you would have seen it, but since you are trying to stay on the same page it isn't going to work like that.
  14. The base script I use for my email processing is from tectite.com. Russell of tectite is very generous for making this formmail script and allowing it's use for free.
  15. I don't think you have to use "this" as a parameter for return_validate_form(). I use an onKeyUp validation on my form, and it doesn't require a parameter.
  16. I've got about 250 pages that use that code without any errors.
  17. In my email processing script, the redirect isn't in the curl that posted to the script, it's in the email processing script itself. If the email validates, the script sends them to thankyou.php, and if not it sends them to error.php. My email form on my business site actually has three different redirects based on what happened while the form was being processed. I do this because the user has an checkbox option to sign up for our newsletter, so "thankyou2.php" gives them the confirmation for that.
  18. It is very easy. Use session_set_cookie_params(604800); 604800 is the number of seconds, so if you want the session to last an hour, then 60*60. This is the amount of time since last page load. I use this: session_name("bookstoreID"); session_set_cookie_params(604800); session_start();
  19. If you really want to do it that way, I'd probably use a $_SESSION array to hold the data from the form. Once the data is in the $_SESSION array, it doesn't go anywhere until it gets unset. On my forms, I use server side validation as a last resort. I use javascript validation for the primary validation. Sure, people can bypass the javascript validation, but if they do, do you really care if you redirect them or not? That's just my 2 cents. I'll PM you a link to my web design home page, and you can check out the javascript.
  20. http://www.phpit.net/article/using-curl-php/ will show you what you wanna know about curl
  21. I don't want to discourage you from learning php, its just that as a web designer, I'm better off not wasting time. When the wheel exists, I don't reinvent it. The tectite formmail is awesome, and is at least a couple thousand lines of code. If you want to learn, you should download it anyways just to see how it works.
  22. Only <?php session_start(); ?> goes at the very top.
  23. Actually, sparkbark, what prime is saying is true. You just need to know that the <?php session_start(); ?> needs to go at the very top of the code, even before your doctype or html tag, and the code should work.
  24. Just go to tectite.com and download their formmail program. It does everything you need, and if it doesn't, you can add hooks.
  25. Post your actual code.
×
×
  • 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.