Jump to content

milesperhour1086

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    uwmicahhuff
  • Website URL
    http://

Profile Information

  • Gender
    Not Telling

milesperhour1086's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Currently, I've got a page, logon.php which contains the form elements username and password. It then passes those to a login.php file which will authenticate them. These pages are located on www.cfddtacoma.org. Once authenticated, I want to pass them from www.cfddtacoma.org to accessSPSC.cfddtacoma.org but for some reason, the session variables that I set in login.php are not carrying over to accessSPSC.cfddtacoma.org: [code]     if(count($result) == 1) {             $getOtherInfo = "SELECT firstName, lastName FROM membership.memberinfo WHERE userID='" . $result[ID] . "' LIMIT 1";             $otherInfoQuery = mysql_query($getOtherInfo,$connection) or die(mysql_error());             $otherInfo = mysql_fetch_array($otherInfoQuery);             $_SESSION[access] = "granted";             $_SESSION[firstName] = $otherInfo[firstName];             $_SESSION[lastName] = $otherInfo[lastName];                          header("Location: http://accessSPSC.cfddtacoma.org/");             } else             header("Location: http://www.cfddtacoma.org/Membership/index.php?error=LoginFailed"); [/code] Then on index.php of accessSPSC.cfddtacoma.org, I have the following check at the top of the page: [code]     session_start();          if($_SESSION[access] != "granted")         header("Location: http://www.cfddtacoma.org"); [/code] However, every time I go from logon.php - > login.php - > accessSPSC.cfddtacoma.org, I am redirected to www.cfddtacoma.org because the $_SESSION[access] value is not granted even though my authentication passed. I tried doing this to login.php (the authentication script): [code]     ini_set('session.cookie_domain', '.cfddtacoma.org');     session_start();     //Authentication stuff     if(count($result) == 1) {         $getOtherInfo = "SELECT firstName, lastName FROM membership.memberinfo WHERE userID='" . $result[ID] . "' LIMIT 1";         $otherInfoQuery = mysql_query($getOtherInfo,$connection) or die(mysql_error());         $otherInfo = mysql_fetch_array($otherInfoQuery);         $_SESSION[access] = "granted";         $_SESSION[firstName] = $otherInfo[firstName];         $_SESSION[lastName] = $otherInfo[lastName];                      header("Location: http://accessSPSC.cfddtacoma.org/");         } else         header("Location: http://www.cfddtacoma.org/Membership/index.php?error=LoginFailed");     ?> [/code] but that doesn't seem to work...probably because I'm not on a personal server but rather a shared one. I have looked around, how would I set something like this up so that I could use cookies??
  2. I am working with a web credit card system and need some help in the following: 1) How do I respond to an HTTPS connection with variables to the system 2) How do I request variables that are posted from an HTTPS connection via SSL?? If you have ever done something like this before, please help!!!
  3. Basically, what's happening is I created an output buffer that will check all hyperlinks and if it finds a mailto: link, it will replace it with mail.php?email=.... . That function, callback($buffer) is used in the output buffer process as follows: [code] <? ob_start('callback'); function callback($buffer) {         global $offset;         if(ereg("<a href=\"mailto:(.*)\".*>.*</a>",$buffer)) {             $buffer = eregi_replace("<a href=\"mailto:(.*)\".*>(.*)</a>","<a href=\"".$offset."/_inc/mail.php?email=\\1\">\\2</a>",$buffer);             $buffer = callback($buffer);         }         return $buffer;     } ?> //SOME HTML GOES HERE <? ob_end_flush(); ?> [/code] What I want to do is add an additional ereg() function in there to check if the link is directed to an @u.washington.edu e-mail address or if the mailto: link is to some e-mail address in general. I only want to make changes to the @u.washington.edu e-mail addresses due to requirements by the department I'm working for. Any suggestions?
  4. If I have an output buffer callback function as follows: [code] function callback($buffer) {         global $offset;         $patternUW = "@u.washington.edu$";         if(ereg("<a href=\"mailto:(.*)\".*>.*</a>",$buffer)) {             $buffer = eregi_replace("<a href=\"mailto:(.*)\".*>(.*)</a>","<a href=\"".$offset."/_inc/mail.php?email=\\1\">\\2</a>",$buffer);             $buffer = callback($buffer);             break;         }         return $buffer;     } [/code] and I want to do the following:[ol type=\'1\'][*]Determine whether @u.washington.edu is the domain its from[*]do a different eregi_replace function if it isn't vs. if it is[*]but don't want a never-ending recursive loop[/ol] how would I do that? I tried a simple if elseif else statement but it turned out to be neverending. Any ideas??
  5. I've got my output buffering setup along with a callback function that will take $buffer as a parameter but when the page loads, only the first instance of my regular expression is replaced with the function eregi_replace(). Here is some of my code: [code] function callback($buffer) {             global $offset;             return (eregi_replace("<a href=\"mailto:(.*)\".*>(.*)</a>","<a href=\"".$offset."/_inc/mail.php?email=\\1\">\\2</a>",$buffer));         }         //Added May 2nd '06 to modify mailto: links on all pages to point to mail.php         ob_start('callback'); // SOME HTML GOES HERE WITH MULTIPLE MAILTO: LINKS ob_end_flush(); [/code] Any idea anybody?? Is there a way to run a loop to continually do it or something??
  6. Here is a much cleaner version of the source code from above...it still only prints the ONE mailto: link and not the other dummy link: [code] <? $offset = ".";     function callback($buffer) {         global $offset;         return (ereg_replace("<a.*href=\"mailto:(.*)\".*>(.*)</a>", "<a href=\"".$offset."/mail.php?email=\\1\">\\2</a>", $buffer));     }     ob_start("callback"); ?> <html> <head> <title>Testing...</title> </head> <body> <p><a href="www.cfddtacoma.org">Link #1 - No Email</a></p> <p><a href="mailto:milesperhour1086@gmail.com">Link #2 - Email  </a></p> </body> </html> <?     ob_end_flush();      ?> [/code]
  7. It has been recommended to use an output buffer and create my ereg function within that so I did but the problem is that I get the following to happen: Starting with this code: [code]     <!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=iso-8859-1" />     <title>Untitled Document</title>     <?         function replaceMailLink($buffer) {             $buffer = ereg_replace("<a.*mailto.*)\".*>(.*)</a>", "<a href=\"$offset/mail.php?email=\\1\">\\2</a>", $buffer);             return $buffer;         }         ob_start();     ?>     </head>     <body>     <a href="www.test.com">This is a test</a>     <a href="mailto:someone@somewhere.com">Micah's E-mail</a>     </body>     </html>     <?                  $buffer = ob_get_contents();         ob_end_clean();         echo replaceMailLink($buffer);     ?> [/code] OUTPUTS ONLY THE FOLLOWING: [code]     <!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=iso-8859-1" />     <title>Untitled Document</title>     </head>     <body>     <a href="/mail.php?email=someone@somewhere.com">Micah's E-mail</a>     </body>     </html> [/code]
  8. [!--quoteo(post=369706:date=Apr 28 2006, 01:48 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Apr 28 2006, 01:48 PM) [snapback]369706[/snapback][/div][div class=\'quotemain\'][!--quotec--] umm well you could use pregmatch or substr to look for the "mailto:" in the link and then convert from there. is that what you are looking for? [/quote] Yeah...that's the idea I'm going for and I knew about those functions...basically, if I could put something in the header that would SEARCH on that page for any links that contains mailto: in it and change it, that would be what I want. We've got a huge site and I would rather not go page by page adding a function call to each and every link.
  9. I am trying to add a new function to our intranet website where, upon loading a page in your web browser, a php script would run that would convert this: [code] <a href="mailto:someone@somewhere.com">Text goes here</a> [/code] into the following [code] <a href="<?=$offset?>/mail.php?email=someone@somewhere.com">Text goes here</a> [/code] This would only apply to the mailto links and no other links on the page. Any ideas anyone?? Would this be something that I can have run "on-the-fly" or is it something that I would have to run server-side??
  10. [!--quoteo(post=357689:date=Mar 23 2006, 09:59 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 23 2006, 09:59 AM) [snapback]357689[/snapback][/div][div class=\'quotemain\'][!--quotec--] it'll be null if you do it in this order. scripting languages do everything in line order, the only exceptions being things such as functions, loops (while, for, foreach, etc). your opening php tag must be <?php too, not php: [/quote] thanks
  11. When creating a page in PHP, if I have the following: [code]     php:$thisVar = $myArray[2];     ..     ..     ..     ..     $myArray = array(1,43,64,44);     ?> [/code] Will thisVar be assigned 64 or will it be null because when we assigned thisVar, myArray did not exist yet?? I am trying to work with dreamWeaver templates and php and this is one of the things I need to figure out but I Don't have webspace to test it out on yet. 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.