Jump to content

tcorbeil

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by tcorbeil

  1. MadTechie, I've tried with the \r, without it, all variations I can think of.. it still isn't formatting.. Is there another way I can go about? T.
  2. actually HeyRay, the full code for my email is.. $headers = "From: xxxx@xxxxx.com \r\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; /*notice there aren't any \r\n after the second two header additions. This is what made this version work correctly*/ mail($email2, "xxxx.com: Registration- Thank you.", $body, $headers); does the the line "$headers.= "Content-Type: text/html; charset=ISO-8859-1 "; " have anything to do with formatting?? T.
  3. Thanks HeyRay but it is not working.. my actual code starts off as $body= "Hello.\n\n".$UserName." blahblahblah... and when I check my email, the format is: Hello. Tim blahblahblah... where I would expect: Hello. Tim blahblahblah... ..any other ideas? T.
  4. Hello, I'm using this line to send an email... mail($email2, "XXXX.com: Registration- Thank you.", $body, $headers); Now the variable $body is quite long and needs to be formated.. so i tried this: $body = "Welcome\nThis is a test\n1)blahblah\n2)blahblah"; Where the outcome i would expect is: Welcom This is a test 1)blahblah 2)blahblah.. obviously isn't formatting with '\n'... any other ways to format in variables or am i chasing a ghost? Thanks T.
  5. Hello again everyone. My site is coming along.. couldn't have done it without this forum, thank you everyone! Anyway, I was hoping to use google adsense to help generate some revenue on my site.. problem is, the site is dynamic and uses mySQL with php.. My question is, is there some sort of way to grab a php variables and append them to a text file of some sort?? That way, i could point the google bot to the 'hard written' text file?.. I don't really know where to start with all of this.. I know my pages do not have "hard" content in them.. only when someone is logged in and the php variables are given their values... Thanks. T.
  6. kenrbnsm, that is brilliant! -Thank you! T.
  7. well here goes: yes i do have the Session start.. I was trying to use a counter to load a session array.. while ($i < $num) { ..some code assigning a value to $first... $_SESSION[$i] = $first; $_SESSION['blah'] = $first; // for troubleshooting I added a this line.. $_SESSION['count2'] = $i; echo $_SESSION['blah']."--"; echo $_SESSION['count2']; } on echo, $_SESSION['count2'] = $i; always took so i rem'd out the $_SESSION[$i] = $first; line and it seemed to work.. of course, $i being a counter, I guess this is not acceptable.. Any ways around this? I can't use a hardwired string to load the session array as the values will change all the time..
  8. ok, in testing, I had this line before any of the code above.. $_SESSION['1'] = "test"; it appears that a session aray cannot be numbers?? T
  9. Is there a maximum amount of variables you can stack into a session array? I have this: $_SESSION['count'] = $first; $_SESSION['blah'] = $first; echo $_SESSION['blah']."--"; echo $_SESSION['count']; the result is always the same, $_SESSION['count'] = $first; seems to take but the second does not.. I do have several other session values.. just wondering if I reched my limit?? I have tried everything I could think of but no go.. T.
  10. Ok, that's cool. one last thing.. is there a way to hide the href link? I want to call my script but I don't the link to show at the bottom of explorer or any web browser for that matter.. Thanks again. T.
  11. Actually, here's another question: Can i do exactly wht you mentioned but instead of calling an external script, call a function instead?? Thanks. T
  12. I don't even know where this question classifies itself but hopefully someone can point me in the right direction: If i have a list as such: -NHL -MLB -NBA -NFL Is there a way to have an option like an 'onclick' where each item that is clicked gives a variable such as $clickedvalue the value of the item clicked while at the same time, routing to a function in separate php file? 1) So let's say i clicked on MLB 2) the variable $clickedvalue = item clicked (in this case MLB) 3) call a function in a separate php file for processing.. 4) return to main script. so far i know of the href=# but with it, i can't really give my variable a value.. Maybe i'm asking much so i do appreciate any ideas. Thanks. T
  13. If I have a table called hockey such as this: submitid Flames Oilers Canucks ------------------------------------------------------------------- 1 | Iginla | Smith 2 | | Roloson | Sedin Concentrating on the Canucks column, basically if i populate the table, let's say for example on line 1, I have data for Flames & for oilers but none for Canuck at the time of entry.. As it stand, when I DO have data for Canucks, I don't want there to be an empty spot.. So if I have data on line one for Flames & Oilers, when I get data for Canucks, I want it to fill out uniform.. Is there an easy way to this? I realize there is commands to alter a row but what is the process to look at row for a specific column, find the first empty space of that row, and fill out that column without leaving spaces between rows.. the end result being: submitid Flames Oilers Canucks ------------------------------------------------------------------- 1 | Iginla | Smith | Sedin 2 | | Roloson | Any help would be much appreciated.. T.
  14. Yes.. actually, that's pretty cool... is there something like that in PHP code?? Thanks. T.
  15. Hello again,. Is there a way to send an email in PHP? If so, can someone point in my the right direction? Thanks. T.
  16. Another thing I'd like to do: I would like for a user to input a site URL. Then a script goes to the website & takes a snapshot of it and returns. The outcome is a file that has a thumbnail picture of a site given by a user.. Any ideas or a point into the proper direction would be appreciated. Thanks. T.
  17. if (preg_match("/^[a-zA-Z_]+(\w+)*((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/i",$Email)){ $messages['ValidEmail'] = "* Your email address is valid, Your Registered! ";} else { $flag = "1"; $messages['InvalidEmail'] = "* Your email address is not valid, please re-enter your email address."; I tought the above would work but apparently it only checks the an email address has all its attributes (******@***.***) it doesn't go check to see if the email is in existence.. what do i need to do to check the email existence? Thanks. T.
  18. Thanks.. anyway to get rid of ...SingleRegister.php?messages=a:1:{i:0;s:4:"tftf";} in the address bar after the transfer has been complete?? the problem is, if there are any errors, it goes back to the form, posts the errors and awaits a resubmit.. so when the user re-submits, where I would have simply SingleRegister.php, I now get SingleRegister.php?messages=a:1:{i:0;s:4:"tftf";} which is a problem... Thanks.
  19. Hi Kenrbnsn. Thanks I'm a step closer.. But can I do something like: $messages = array('','test',$flag['PassNotFilled'],$flag['EmailNotFilled'],$flag['UserTaken'],$flag['PassMatch'],$flag['InvalidEmail']); If i do this, it seems the values from the variables do not pass but the hard text 'test' works... any ideas?
  20. Hey Taith. Thanks, that fixed that problem.. now i get the error: Parse error: syntax error, unexpected '=', expecting ')' in /home/tcorbeil/public_html/Dreamweaver/SingleRegister.php on line 62 line 62 being: foreach($_SERVER['QUERY_STRING'] as $k=$v) $file[$k]=$v;
  21. Also, I get the error: Parse error: syntax error, unexpected '=' in /home/tcorbeil/public_html/Global/SingleValidate.php on line 91 line 91 being this line: @header("Location: ".$_SERVER['HTTP_REFERER']?flag=$get);
  22. Thanks for the tip Taith.. How would I get the info at the other end? something like $flag = $_GET['flag']; ECHO $flag['1']; ECHO $flag['2']; output on screen testme is this the way?
  23. Here is the exact code of the script: <? // GET ALL FORM VARIABLES $UserName = $_POST['UserName']; $UserPassword = $_POST['UserPassword']; $VerifyPass = $_POST['VerifyPass']; $Email = $_POST['Email']; //function declaration //------------------------------------------------------------------------------------------------------------------ // FUNCTION CHMOD if (!function_exists('ftp_chmod')) { function ftp_chmod($ftp_stream, $mode, $filename) { return ftp_site($ftp_stream, sprintf('CHMOD %o %s', $mode, $filename)); } } //------------------------------------------------------------------------------------------------------------------ // FUNCTION LOGIN INFO function loginmySQL() { include("/home/tcorbeil/public_html/Global/config.php"); mysql_connect(localhost, $config['dbUser'], $config['dbPassword']) or DIE(print_r($config, true)); @mysql_select_db(tcorbeil_SingleRegister); $config = null; // erase all database connection from memory. } //------------------------------------------------------------------------------------------------------------------ // CHECK USERNAME FOR CONTENT AND FOR DUPLICATES function ValUsername(){ !loginmySQL(); $query="SELECT * FROM `Personal_Register` WHERE UserName = '$UserName'"; $result=mysql_query($query) or die("Query failed: $query\nError: " . mysql_error()); $num_rows = mysql_num_rows($result); mysql_close(); if ($num_rows == 1) { $flag['UserTaken']= "The user name you entered has already been taken, please choose another user name."; } } //------------------------------------------------------------------------------------------------------------------ // CHECK FOR BLANK PASSWORDS AND RE-ENTRY VERIFICATION MATCH function ValPassword(){ if ($UserPassword != $VerifyPass) { $flag['PassMatch'] = "Your password entries do not match; Please re-enter your password."; } } //------------------------------------------------------------------------------------------------------------------ // VALIDATE EMAIL function ValEmail(){ if(preg_match("/^[a-zA-Z_]+(\w+)*((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/i",$Email)){ return true;} else { $flag['InvalidEmail'] = "Your email address is not valid, please re-enter your email address."; return false;} } //------------------------------------------------------------------------------------------------------------------ // LET'S MAKE SURE ALL FIELDS ARE FILLED OUT... function ValFormFilled(){ if ($UserName = ""){ $flag['UserNotFilled'] = "The user name field cannot be left blank, please enter a user name."; } If ($UserPassword == "") { $flag['PassNotFilled'] = "The password field cannot be left blank, please enter a password."; } If ($Email == "") { $flag['EmailNotFilled']= "The password field cannot be left blank, please enter a password."; } } !ValFormFilled(); if ($flag['UserNotFilled'] != ""){ !ValUsername(); } if ($flag['PassNotFilled'] != ""){ !ValPassword(); } if ($flag['EmailNotFilled'] != ""){ !ValEmail(); } @header("Location: ".$_SERVER['HTTP_REFERER']);.... basically I need to send the flag array back.. would the solution presented still be possible?? //$query="SELECT * FROM UserName WHERE UserName = '$UserName'"; //$result=mysql_query($query); //$row = mysql_fetch_array($result); // got the data now //$filename = $row['refdatabase']; ?>
×
×
  • 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.