Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Importowanie kontaktów
Forum PHP.pl > Forum > PHP
Walassss
Witam wszystkich,

Mam problem związany z importowaniem kontaktów... Mieszkam w Holandii i wynająłem jakiegoś słabego programistę i się chyba pogubił thumbsdownsmileyanim.gif

Chodzi o o to że gość użył czegoś takiego jak to http://www.phpkode.com/scripts/item/contacts-importer/
i jeśli klikniemy wstecz na stronę gdzie te sesje zostają "wywołane" to wtedy one przepadają...
Problemem jest to że wszystko działa na IE, ale na innych przeglądarkach już nie.
  1. if (!empty($contacts))
  2.  
  3. {
  4.  
  5. ?>
  6.  
  7.  
  8. <div id="textmail">
  9.  
  10. <div class="details">
  11. <h3>Selecteer de email adressen die u wilt uitnodigen.</h3>
  12. <form method="post" action="<? echo $_SERVER['PHP_SELF']?>">
  13. <div style=" float:left; clear:both;"> <input class="check-all" type="checkbox" /></div><div style="float:left; margin-left:10px;"><b>Selecteer alles</b></div>
  14. <div style="clear:both"></div>
  15.  
  16. <?php
  17.  
  18. for ($i=1; $i < sizeof($contacts); $i++)
  19. {
  20. if ($contacts[$i]->email !=='')
  21. {
  22. ?>
  23. <div style=" float:left; clear:both;"> <input type="checkbox" name="selectEmail[]" value="<?=$contacts[$i]->email?>"></div><div style="float:left; margin-left:10px;"><?=$contacts[$i]->email?></div>
  24. <?php
  25. }
  26. }
  27. ?>
  28. <div style="float:right; margin-bottom:10px;"> <input type="submit" name="submit" class="button" value="Verstuur" ></div>
  29. </form>
  30. </div>
  31.  
  32. </div>
  33.  
  34. <?php
  35.  
  36.  
  37.  
  38.  
  39. // invite mail versturen
  40.  
  41. } else if ($_POST['submit']=='Verstuur')
  42. {
  43. $DB = new DB();
  44. $from = ''.SITE_TITLE.'- Onderdeel van ';
  45. $reply = 'no-reply@xxxxxx.nl';
  46.  
  47.  
  48. $_SESSION['profielId'] = $DB->getProfielId($_SESSION['email'],PROJECT_ID);
  49.  
  50. $email = array();
  51. $email = $_POST['selectEmail'];
  52. //print_r($id);
  53. if (count($email) > 0)
  54. {
  55. foreach ($email as $selectEmail)
  56. {
  57. include(LOCAL_ROOT.'inc/invitemail.php');
  58. $DB->insertEmail('invites', $_SESSION['profielId'], $selectEmail,PROJECT_ID);
  59.  
  60. $mail = new CHmail($selectEmail,$from,$reply,"Uitnodiging",$body);
  61. $mail->send();
  62.  
  63.  
  64. }
  65.  
  66. }
  67.  
  68. ?>


I jeśli klikniemy wstecz to ta sesja "przepada(?)" ... sadsmiley02.gif

Moja wiedza w PHP kończy się na prostych divach więc nie mam pojęcia w czym jest problem...

Pozdrawiam,
Patryk

EDIT: Dowiedziałem się jeszcze że:

z jednej formuły robi sesje:

$_SESSION['email'] = $_POST['email'];

nastepnie zostaje wywolane: <?=$import->getWLLLink()?>

i nastepnie otrzymujemy listę kontaktów z msn'a...
Ilware
Jeżeli dobrze zrozumiałem to naciśnięciu przycisku "Verstuur" przepadają zmienne w $_SESSION a konkretnie przepada zmienna 'email'?

Po naciśnięciu wstecz ponownie wywołujesz metodę

  1. $_SESSION['email'] = $_POST['email'];


a w tej zmiennej nic nie ma, więc przypisujesz null do $_SESSION['email'] do którego się odnosisz w dalszej części kodu

zamień

  1. $_SESSION['email'] = $_POST['email'];


na

  1. if(isset($_POST['email']) && trim($_POST['email'])!="")
  2. $_SESSION['email'] = $_POST['email'];


jak nie pomoże to daj resztę kodu bo tylko się domyślam że to to

p.s.
  1. $import->getWLLLink()
nic nie robi w tej sprawie tylko zwraca linki

  1. function getWLLLink () {
  2. $link = 'https://consent.live.com/Delegation.aspx?RU='.urlencode($this->returnURL);
  3. $link .= '&ps=Contacts.View&pl='.urlencode($this->WLLPolicy);
  4. return $link;
  5. }
Walassss
Nie pomoglo, albo sie na tym nie znam... Wczoraj może niedokładnie powiedziałem o co chodzi, ale sam do końca nie wiedziałem smile.gif

To jest tak ze mamy "punkt 1" i tam wypełniamy swoje dane osobowe, które tworzą później profil w naszym systemie.
Klikasz dalej i masz "punkt 2" i tam trzeba (lub nie trzeba) zaprosić znajomych z MSN'a lub GMAIL'a i potem jest kolejny punkt i tam jest ankieta...

Chodzi o to ze ten profil nie zostaje stworzony przy probie zaproszenia znajomych z MSN'a... Z GMAIL'u tworzy się normalnie.
Jesli pominiemy ten punkt z zaproszeniami znajomych to wtedy tez tworzy się ten profil.

Zaproszenia znajduja sie w "stap2.php" czyli punkcie drugim.

CALY STAP2
  1. <?php
  2. //ini_set('display_errors', 1);
  3. //error_reporting(E_ALL);
  4.  
  5.  
  6.  
  7.  
  8. include('config.php');
  9.  
  10. include(LOCAL_ROOT.'class/contacts_importer.class.php');
  11. include(LOCAL_ROOT.'inc/invite.php');
  12. include (ADMIN_ROOT.'class/class.php');
  13. $DB = new DB();
  14.  
  15.  
  16. ?>
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  18.  
  19.  
  20. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  21.  
  22. <!-- #################################################-->
  23. <!-- Made by: www.DIRECTBASING.com -->
  24. <!-- Semantisch correcte xHTML Basing -->
  25. <!-- #################################################-->
  26.  
  27. <head>
  28.  
  29. <title><?=SITE_TITLE?></title>
  30. <script type="text/javascript" src="<?=IMG_ROOT?>2010/resources/scripts/jquery-1.3.2.min.js"></script>
  31. <script type="text/javascript" src="<?=IMG_ROOT?>2010/resources/scripts/simpla.jquery.configuration.js"></script>
  32.  
  33.  
  34. <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  35. <meta http-equiv="cache-control" content="no-cache" />
  36. <meta http-equiv="pragma" content="no-cache" />
  37.  
  38. <meta name="keywords" content="key, words" />
  39. <meta name="description" content="<?=SITE_DESCRIPTION?>" />
  40. <meta name="robots" content="noindex, nofollow" /><!-- change into index, follow -->
  41.  
  42.  
  43. <link rel="stylesheet" href="stylesheets/global.css" type="text/css" />
  44.  
  45. <?php
  46.  
  47. include (LOCAL_ROOT.'js/script.php');
  48.  
  49. ?>
  50. </head>
  51.  
  52. <body>
  53. <div align="center">
  54. <!-- / wrapper \ -->
  55. <div id="wrapper" align="center" style="text-align:left">
  56.  
  57. <!-- / main container \ -->
  58. <div id="mainCntr">
  59.  
  60. <!-- / header container \ -->
  61. <div id="headerCntr">
  62.  
  63. <h1><a href="#">Gratis Spiegel</a></h1>
  64.  
  65. <!-- / menu box \ -->
  66. <div class="menuBox">
  67.  
  68. <ul>
  69. <li><a href="index.php">Home</a></li>
  70. <li><a href="bestelstatus.php">Bestelstatus</a></li>
  71. <li><a href="uitleg.php">Uitleg</a></li>
  72. <li><a href="faq.php">Faq</a></li>
  73. <li><a href="contact.php">Contact</a></li>
  74. </ul>
  75.  
  76. </div>
  77. <!-- \ menu box / -->
  78.  
  79. </div>
  80. <!-- \ header container / -->
  81.  
  82. <!-- / banner container \ -->
  83. <div id="bannerCntr">
  84.  
  85. <div class="details">
  86.  
  87. <h3>Wil Jij Ook Een Spiegel?</h3>
  88.  
  89. <p>Vaak is een gratis product nooit helemaal gratis. Of je moet een deel bijbetalen, of je moet verzendkosten betalen. Wij streven ernaar om producten <b>VOLLEDIG</b> te houden.</p>
  90.  
  91. <p>Vanzelfsprekend is het natuurlijk dat er wel wat tegenover staat. Dat is een stukje tijd. Wij vragen je na het invullen van het formulier een enquete voor ons in te vullen. Dit neemt slechts enkele minuten tijd in beslag.</p>
  92.  
  93. <p>Verder zit je helemaal nergens aan vast en tot volgende bestellingen. Vul snel het formulier op onze homepage in. In slechts 3 eenvoudige stappen heb je <b>JOUW</b> besteld.</p>
  94.  
  95. </div>
  96.  
  97. </div>
  98. <!-- \ banner container / -->
  99.  
  100. <!-- / content container \ -->
  101. <div id="contentCntr">
  102. <!-- / form container \ -->
  103. <div id="formCntr">
  104.  
  105. <?php
  106.  
  107.  
  108. // registratiemail
  109. if (isset($_POST['submit']) && $_POST['submit']!='Verstuur')
  110. {
  111. include(LOCAL_ROOT.'inc/regemail.php');
  112.  
  113.  
  114. $_SESSION['email'] = $_POST['email'];
  115. $sessiemail = $_POST['email'];
  116. $_POST['geboortedatum'] = $_POST['jaar'].'-'.$_POST['maand'].'-'.$_POST['dag'];
  117.  
  118. $from = ''.SITE_TITLE.'- Onderdeel van XXX';
  119. $reply = 'no-reply@xxx.nl';
  120.  
  121.  
  122. $DB->insertTableRow('profiel', $_POST);
  123.  
  124. $mailReg = new CHmail($_SESSION['email'],$from,$reply,"Registratie ".SITE_TITLE."",$bodyReg);
  125. $mailReg->send();
  126. ?>
  127.  
  128. <div id="text">
  129.  
  130. <div class="details">
  131.  
  132. <h3>Registratie succcessvol voltooid</h3>
  133.  
  134. <p>
  135. voordat je verder gaat vragen wij je nu om je vriend(-innen) op de hoogte te stellen van de Mascara actie door ze een tip te versturen. (er wordt slechts 1 berichtje verstuurd).
  136. </p>
  137.  
  138. <p>Voor dit onderdeel kunt u gebruik maken van Windows Live en Gmail. Je kunt zelf bepalen welke vriend(-innen) je een "tip" wilt versturen. Log mij safe in via de Windows Live Verbinding of Gmail. Klik op 1 van de logo's, of sla deze stap over en klik <a href="stap3.php" target="_self">hier</a></p>
  139. <p><br><br>
  140. <div class="line">
  141. <span class="left"><a href="<?=$import->getGMailLink()?>"><img src="images/gmail.jpg"></a></span><span class="centre"><a href="<?=$import->getWLLLink()?>"><img src="images/live.jpg"></a></span>
  142. </div>
  143. </div>
  144.  
  145. </div>
  146.  
  147.  
  148. <?
  149.  
  150. } else if (!empty($contacts))
  151.  
  152. {
  153.  
  154. ?>
  155.  
  156.  
  157. <div id="textmail">
  158.  
  159. <div class="details">
  160. <h3>Selecteer de email adressen die u wilt uitnodigen.</h3>
  161. <form method="post" action="<? echo $_SERVER['PHP_SELF']?>">
  162. <div style=" float:left; clear:both;"> <input class="check-all" type="checkbox" /></div><div style="float:left; margin-left:10px;"><b>Selecteer alles</b></div>
  163. <div style="clear:both"></div>
  164.  
  165. <?php
  166.  
  167. for ($i=1; $i < sizeof($contacts); $i++)
  168. {
  169. if ($contacts[$i]->email !=='')
  170. {
  171. ?>
  172. <div style=" float:left; clear:both;"> <input type="checkbox" name="selectEmail[]" value="<?=$contacts[$i]->email?>"></div><div style="float:left; margin-left:10px;"><?=$contacts[$i]->email?></div>
  173. <?php
  174. }
  175. }
  176. ?><input type="hidden" name="email" value="<?=$_SESSION['email']?>">
  177. <div style="float:right; margin-bottom:10px;"> <input type="submit" name="submit" class="button" value="Verstuur" ></div>
  178.  
  179. </form>
  180. </div>
  181.  
  182. </div>
  183.  
  184. <?php
  185.  
  186.  
  187.  
  188.  
  189. // invite mail versturen
  190.  
  191. } else if ($_POST['submit']=='Verstuur')
  192. {
  193. $DB = new DB();
  194. $from = ''.SITE_TITLE.'- Onderdeel van xxx';
  195. $reply = 'no-reply@xxx.nl';
  196.  
  197. //$_SESSION['email2'] = $_SESSION['email'];
  198. $_SESSION['email2'] = $_POST['email'];
  199. $_SESSION['profielId'] = $DB->getProfielId($_SESSION['email2'],PROJECT_ID);
  200.  
  201. $email = array();
  202. $email = $_POST['selectEmail'];
  203. //print_r($id);
  204. if (count($email) > 0)
  205. {
  206. foreach ($email as $selectEmail)
  207. {
  208. include(LOCAL_ROOT.'inc/invitemail.php');
  209. $DB->insertEmail('invites', $_SESSION['profielId'], $selectEmail,PROJECT_ID);
  210.  
  211. $mail = new CHmail($selectEmail,$from,$reply,"Uitnodiging",$body);
  212. $mail->send();
  213.  
  214.  
  215. }
  216.  
  217. }
  218.  
  219. ?>
  220. <div id="textmail">
  221.  
  222. <div class="details">
  223.  
  224.  
  225. <h1>Start de vragenlijst!</h1>
  226.  
  227. <p>
  228. <?=$voornaam?> , je hoeft nu nog maar 1 ding te doen en onze verzend afdeling zal jouw spiegel binnen 7 dagen verpakken en aan jou verzenden. Geef antwoord op onze vragen in de enqu?te en klik daarna op de button "Ga naar de finish!".
  229.  
  230.  
  231.  
  232.  
  233.  
  234. <?php
  235. $inviteemail = $_SESSION['email2'];
  236. //echo $inviteemail;
  237. //echo 'test';
  238. echo $_SESSION['profielId'] ;
  239.  
  240.  
  241. if ($_SESSION['profielId']!='')
  242. {
  243.  
  244. $profId = $DB->getProfId('profiel',$inviteemail,PROJECT_ID);
  245. $DB->showEnquete('affiliates',PROJECT_ID,$_SESSION['profielId']);
  246. } else {
  247. $profId = $DB->getProfId('profiel',$inviteemail,PROJECT_ID);
  248. $DB->showEnquete('affiliates',PROJECT_ID,$profId);
  249.  
  250. }
  251.  
  252. ?>
  253. <br />
  254. <p>Klik <b>nadat</b> je de enqu?te hebt ingevuld op de onderstaande button, hiermee verstuur je jouw gegevens naar onze postafdeling verpakken en klaar maken voor verzending!
  255. </p>
  256. <a href="finish.php"><img src="images/verder.png" alt=""/></a>
  257. <p>* je ontvangt altijd binnen 7 werkdagen 100% gratis in huis, en je zit nergens aan vast (gratis=gratis).
  258.  
  259. </p></p>
  260.  
  261. <br />
  262.  
  263.  
  264. </div>
  265.  
  266. </div>
  267.  
  268. <?php
  269. } else {
  270.  
  271. ?>
  272. <?php session_destroy();?>
  273. <script>window.location.href = 'index.php';</script>
  274. <?php
  275. } ?>
  276. </div>
  277. <!-- \ form container / -->
  278.  
  279. </div>
  280. <!-- \ content container / -->
  281.  
  282. </div>
  283. <!-- \ main container / -->
  284.  
  285. <?php include('footer.php'); ?>
  286.  
  287. </div>
  288. <!-- \ wrapper / -->
  289. </div>
  290. </body>
  291.  
  292. </html>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.