Jump to content

gsmith

Members
  • Posts

    61
  • Joined

  • Last visited

Posts posted by gsmith

  1. haha. Thanks.It actually isn't spam though - I promise. :)It's for a website that has a user log-in system and the e-mails are being sent from a user to a selected user(s), hence the potential for an array of several e-mail addresses.

  2. I've been sending e-mail within PHP scripts using the following basic commands:

    $to="someemailaddress";$message="message";$subject="subject";mail($to, $subject, $message);

    However, now I have an array with several e-mail addresses in it. Using that same format won't send my mail. How can I send an e-mail using multiple e-mail addresses inside an array instead of one defined variable?

  3. header("Location: mypage.php?id=1");

    That's correct, but if there are some pages where linking to page1.php is ok, there would have to be some kind of conditional test first. Perhaps passing a query string with the "ok" link to test whether or not the page1.php should be displayed or redirected....and if the query string value doesn't exist, then you could redirect.
  4. I'm not exactly sure what your header problem is....but you could cut down some of your code and just use the file command....Instead of:

    $filename = 'password.txt';   $fp = fopen( $filename, 'r' );   $file_contents = fread( $fp, filesize( $filename ) );   fclose( $fp );   // Place the individual lines from the file contents into an array.   $lines = explode ( "\n", $file_contents );

    You could have:

    $filename = 'password.txt';$lines=file($filename);

    file() will read the contents of a file into an array. :)

  5. Ain't nothing wrong with that. However, as I've said before, not everyone can afford Dreamweaver. Bluefish is a good OSS alternative, but it's not quite the same. Us poor folk might just stick with hand-code in an OSS text editor :)

    I still understand your point. I still agree too - just wanted to point out that WYSIWYG programs can be ok too.Poor me started about 10 years ago with Notepad and HTML. :)
  6. Well, I never said WYSIWYG editors can't make good sites, I just adviced him to code from scratch. You learn more, the code makes more sense (instead of being gross as aspnetguy so excellently put it :)), and you have FULL control of layout/design/graphic elements used.

    I understand that. I started off always coding everything myself (to learn mostly). I still go back and edit a lot of the code even when using programs like Dreamweaver.
  7. Just a note on Jonas' comments...I just finished building a site that took all weekend, plus a few evenings during the week last week. I used Dreamweaver 8, and IMHO, it looks decent - even professional. :) The trick was, I did use a server-side language (PHP) to make the site more dynamic and powerful. Dreamweaver helped make it "look" cleaner. I disagree that WYSIWYG programs can't make good sites, but I would agree that you would have to incorporate some other helpful programming yourself.

  8. Before your response, I had searched PHP.net.I tried using strpos()

    foreach($temp as $value)    {      if(!(strpos($value, $usr)))      {        fwrite($fs, $value);      }    }

    $temp is the array I got using the file() command. I want to write to the file $fs all the lines in $temp, except for the line that contains within it somewhere the same exact value that $usr holds.The above code has worked if the line in question is the last line of the file. But if it's in the middle, this code stops writing the remaining lines back to the file once the one line in question is found.

  9. I am currently reading a file into an array:

    $newthing=file(filename);

    each line I read in will be of the general format:$uname[0]=username; $known_as[0]=realname;$uname[1]=username; known_as[1]=realname;etc.I have another variable, we'll call it $x. $x will equal the username portion of one of the above lines. I want to do other things (that I do know how to do) ONLY IF $x is NOT in the line that I've read into the $newthing array. How can I search and determine this line by line?

  10. I've been taking advantage of putting various information in my URL's and retrieving them on the next page with the $_GET[] command.I now have one point where I'd like to send a variable in the URL....but it's an array, and I won't even know the size of the array until run-time. (It is a single dimension array though) Can this be done? If so, how?

  11. That is what seems to be the problem, my hosting service had informed me that the code had to be php to work on the site (I used thier software to design my website) is there any place where i can find a simple code to copy and paste into my html? just a simple "tell a friend about this site" code

    That doesn't make any sense. It's my understanding that javascript is run on the client side, within the browser itself. Which means your hosting server would be of no factor in the equation...only your users' browser (and whether or not they have Javascript disabled) would matter.I'd still suggest taking this to the Javascript forum and trying it out on your site. I have a hard time believing that javascript is dissabled on your hosting site.
  12. I have validation on some pages that will return an error. Currently my scripts print the error message, and include the original page so the user can re-enter the items....so my error message is at the top of the previously displayed page.Is there a way to format where that error message goes? Could I get it to display the previous page and put the error message next to or under the incorrect item...and how would I do that?

×
×
  • Create New...