Jump to content

biwerw

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Everything posted by biwerw

  1. No Problem. Was looking for it on the right side but couldn't find it and thought maybe I dreamed this Forum had one. Consider this topic solved.
  2. I'm sure you already know, but that worked perfect. Thanks a lot everyone for the help.
  3. That should work however I'm using one of the input variables from the form to create the name for the .html file so each time would be different. How would I use a $info inside the code you provided? Below is what I attempted, but failed. <?php header('Location: "$cuidnumber".html'); ?>
  4. I have a script that takes input from a form and creates a .html file based upon what was entered. I would like for the end result to load the created page in the browser. I can't seem to find the correct code to do so. Any help would be great.
  5. I've removed all images and links to images. For some reason it still shows up as spam some of the time. I am using some basic HTML & inline CSS could this be making it be regarded as spam as well. I am also including a email and address in the email footer.
  6. I have been asked by a client to build a small webapp for sending referral emails to friends. I have setup a pretty simple form that uses php to send the email. It contains 1-2 images which apparently alert spam filters no matter what. Is there any solution to including images and not having the email get caught? Besides using a service like Mail Chimp. The app will be for the clients internal use only and in no way available to the public. Any ideas or solutions would be greatly appreciated. Thanks.
  7. Thanks everyone, I got everything working.
  8. Awesome, that did the trick. I had one other simple question. I have the prices being input in text fields and diplayed on the next page. Right now the "per Lb." is displayed after each price. How can I adjust this to only show up if they have entered a price? Currently: <p class="right"><?php echo $price4 ?> per Lb.</p> What I would like (obviously not working...): <p class="right"><?php echo $price4 "per Lb." ?> </p>
  9. Sorry, i declared the variables at the top of the 2nd page. The error is: Notice: Undefined index: al-pc in E:\www\mymarketinglab.com\clients\landolakes\printform\submit.php on line 10 <?php $lolwtam = $_REQUEST['lol-wt-am'] ; $lolyeam = $_REQUEST['lol-ye-am'] ; $lol2wam = $_REQUEST['lol-2w-am'] ; $lol2yam = $_REQUEST['lol-2y-am'] ; $lolcmc = $_REQUEST['lol-cmc'] ; $alrfsc = $_REQUEST['al-rfsc'] ; $almc = $_REQUEST['al-mc'] ; $alac = $_REQUEST['al-ac'] ; $alpc = $_REQUEST['al-pc'] ; $price1 = $_REQUEST['v1'] ; $price2 = $_REQUEST['v2'] ; $price3 = $_REQUEST['v3'] ; $price4 = $_REQUEST['v4'] ; $price5 = $_REQUEST['v5'] ; $price6 = $_REQUEST['v6'] ; $price7 = $_REQUEST['v7'] ; $price8 = $_REQUEST['v8'] ; $price9 = $_REQUEST['v9'] ; ?>
  10. I have a form setup with 9 check boxes. When the form is submitted I would like the values that have been checked to be displayed on the next page. I am running into the problem that when a check box isn't selected I receive an error on the next page. Any help would be awesome. Thanks. Here is the code for the form. <form method="post" action="submit.php"> <table width="432" border="0" cellspacing="0" cellpadding="0"> <tr><td colspan="4"><img src="header-lol.jpg" alt="LAND O' LAKES Premium Deli Cheese | America's Favorite - Sliced Fresh" /></td></tr> <tr> <td width="313" align="left"><p class="left"><label><input name="lol-wt-am" type="checkbox" value="LAND O LAKES® White American Cheese" />LAND O LAKES® White American Cheese</label></p></td> <td colspan="3"><p class="right"><input name="v1" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td><p class="left"><label><input name="lol-ye-am" type="checkbox" value="LAND O LAKES® Yellow American Cheese" />LAND O LAKES® Yellow American Cheese</label></p></td> <td colspan="3"><p class="right"><input name="v2" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td><p class="left"><label><input name="lol-2w-am" type="checkbox" value="LAND O LAKES® 2% Milk White American Cheese" />LAND O LAKES® 2% Milk White American Cheese</label></p></td> <td colspan="3"><p class="right"><input name="v3" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td><p class="left"><label><input name="lol-2y-am" type="checkbox" value="LAND O LAKES® 2% Milk Yellow American Cheese" />LAND O LAKES® 2% Milk Yellow American Cheese</label></p></td> <td colspan="3"><p class="right"><input name="v4" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td><p class="left"><label><input name="lol-cmc" type="checkbox" value="LAND O LAKES® Creamy Muenster Cheese" />LAND O LAKES® Creamy Muenster Cheese</label></p></td> <td colspan="3"><p class="right"><input name="v5" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td colspan="4" align="right"><img src="header-al.jpg" alt="Alpine Lace: Better For You - Sliced Fresh" /></td> </tr> <tr> <td colspan="3"><p class="left"><label><input name="al-rfsc" type="checkbox" value="Alpine Lace® Reduced Fat Swiss Cheese" />Alpine Lace® Reduced Fat Swiss Cheese</label></p></td> <td width="109"><p class="right"><input name="v6" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><label><input name="al-mc" type="checkbox" value="Alpine Lace® Muenster Cheese" />Alpine Lace® Muenster Cheese</label></p></td> <td><p class="right"><input name="v7" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><label><input name="al-ac" type="checkbox" value="Alpine Lace® American Cheese" />Alpine Lace® American Cheese</label></p></td> <td><p class="right"><input name="v8" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><label><input name="al-pc" type="checkbox" value="Alpine Lace® Provolone Cheese" />Alpine Lace® Provolone Cheese</label></p></td> <td><p class="right"><input name="v9" type="text" size="8" />per Lb.</p></td> </tr> <tr> <td colspan="4" align="center"><p><input type="submit" class="submit_button" value="Submit" tabindex="" /></p></td> </tr> </table> </form> And the code for the page it is pulled and displayed on: <table width="432" border="0" cellspacing="0" cellpadding="0"> <tr><td colspan="4"><img src="header-lol.jpg" alt="LAND O' LAKES Premium Deli Cheese | America's Favorite - Sliced Fresh" /></td></tr> <tr> <td width="313" align="left"><p class="left"><?php echo $lolwtam ?></p></td> <td colspan="3"><p class="right"><?php echo $price1 ?> per Lb.</p></td> </tr> <tr> <td><p class="left"><?php echo $lolyeam ?></p></td> <td colspan="3"><p class="right"><?php echo $price2 ?> per Lb.</p></td> </tr> <tr> <td><p class="left"><?php echo $lol2wam ?></p></td> <td colspan="3"><p class="right"><?php echo $price3 ?> per Lb.</p></td> </tr> <tr> <td><p class="left"><?php echo $lol2yam ?></p></td> <td colspan="3"><p class="right"><?php echo $price4 ?> per Lb.</p></td> </tr> <tr> <td><p class="left"><?php echo $lolcmc ?></p></td> <td colspan="3"><p class="right"><?php echo $price5 ?> per Lb.</p></td> </tr> <tr> <td colspan="4" align="right"><img src="header-al.jpg" alt="Alpine Lace: Better For You - Sliced Fresh" /></td> </tr> <tr> <td colspan="3"><p class="left"><?php echo $alrfsc ?></p></td> <td width="109"><p class="right"><?php echo $price6 ?> per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><?php echo $almc ?></p></td> <td><p class="right"><?php echo $price7 ?> per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><?php echo $alac ?></p></td> <td><p class="right"><?php echo $price8 ?> per Lb.</p></td> </tr> <tr> <td colspan="3"><p class="left"><?php echo $alpc ?></p></td> <td><p class="right"><?php echo $price9 ?> per Lb.</p></td> </tr> </table>
  11. Here is the php file that is run once the upload button is pressed on the form. I have a lot of the php settings commented out since i have adjusted them in my cgi-bin/php.ini file. <? Echo "<!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=UTF-8' /> <meta http-equiv='cache-control' content='no-cache'> <meta http-equiv='pragma' content='no-cache'> <title>Page Title</title> <!--CSS--> <link href='../assets/css/style.css' type='text/css' rel='stylesheet' title='print' media='screen' /> <!--JAVASCRIPT--> <!--[if lte IE 6]> <script src='http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js' type='text/javascript'></script> <![endif]--> </head> <body> <div id='layout'> <div id='layout-top'> <div id='top-nav'> <p><a href='upload.php'>« BACK</a> | <a href='../logout.php'>LOGOUT</a></p> </div><!--top-nav end--> </div><!--layout-top end--> <br class='clear' /> <div id='layout-header'> <div class='mlab-type' align='center'><img src='../assets/images/logo-original-trans.png' alt='Logo' /></div> </div><!--layout-header end--> <div id='layout-content'> <div id='content-top'></div> <div id='content-middle'> <div align='center'> <img src='../assets/images/label-thankyou-trans.png' alt='Thank You' style='margin:0 auto;' /> "; //uses $_FILES[] global array //see manual for older PHP version info //This function will be used to get the extension from the filename Function get_extension($file,$length=-1){ $p = strrpos($file,"."); $p++; If($length!=-1){ $ext = substr($file,$p,$length); } If($length==-1){ $ext = substr($file,$p); } $ext = strtolower($ext); Return $ext; } //reset time limits to not time out on larger files //Ini_set('max_execution_time',0); //Ini_set('max_input_time',0); Ini_set('set_time_limit',0); ?> <? //check to see if we have submited yet If($_POST["submit"]!="submit"){ //not yet so lets make the form ?> <? } //see if we have submited and that the files array has been set If(($_POST["submit"]=="submit")&&(is_array($_FILES['userfiles']))){ $ftp_user_name="FTPUSERNAME"; //change to ftp username $ftp_user_pass="FTPPASS"; //change to ftp password $ftp_server="FTPURL"; //change to ftp url $ftp_dump_dir="/upload-general"; //change to destination directory //Not good practice, but here anyway //change to suit your needs //also some have to be set in the ini //for this to correctly work //2meg max //Ini_set("upload_max_filesize","1000M"); //turn on file uploads //Ini_set("file_uploads","1"); //set your temp dir Ini_set("upload_tmp_dir","/tmp"); //set post size large enough to accomidate //3 100meg files and some overhead //Ini_set("post_max_size","1000M"); //go through all the files For($x=0;$x<count($_FILES['userfiles']['name']);$x++){ //now we do some file checking //check to see if file is there If($_FILES['userfiles']['name'][$x]!="none"){ //file has a name //check filesize If($_FILES['userfiles']['size'][$x]!=0){ //file is larger than 0 bytes //Check to see if it is uploaded If(is_uploaded_file($_FILES['userfiles']['tmp_name'][$x])){ //file has been uploaded! //let the user know their file has be uploaded Echo "<p>".$_FILES['userfiles']['name'][$x]." uploaded successfully!</p>"; //conect to ftp server $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection If ((!$conn_id) || (!$login_result)) { Echo "<p>FTP connection has failed!</p>"; Echo "<p>Attempted to connect to $ftp_server for user $ftp_user_name</p>"; Exit; } else { //Echo "<p>Connected to $ftp_server!</p>"; //set PASV mode If(!ftp_pasv($conn_id,TRUE)){ Echo "<p>Could not enter PASV mode!</p>"; } //rename to file#_date.Ext $filename = $_FILES['userfiles']['name'][$x]; //$filename.= ".".Get_extension($_FILES['userfiles']['name'][$x],3); //change directory If (@ftp_chdir($conn_id, $ftp_dump_dir)) { //maybe you want to make sure we are in the correct directory //Echo "Current directory is now : ", ftp_pwd($conn_id), "\and"; } else { //you want to know if it didn't work Echo "Couldn't change directory\and"; } //upload the file and let the user know what happened If(ftp_put($conn_id,$filename,$_FILES['userfiles']['tmp_name'][$x],FTP_BINARY)){ //Echo "<p>File ".$_FILES['userfiles']['name'][$x]." was sent successfully</p>"; //Echo "<p>File was named ".$filename."</p>"; }else{ Echo "There was a problem sending file ".$_FILES['userfiles']['name'][$x]."<br>";; } } // close the FTP stream Ftp_close($conn_id); } Else echo"<p>File was not uploaded!</p>"; } } }//end for loop Echo "<p class='back'><a href='upload.php'>«Back</a></p>"; } Echo "</div> </div><!--content-middle end--> <div id='content-bottom'></div> </div><!--layout-content end--> </div><!--layout end--> </body> </html>"; ?>
  12. I'm using a script that uploads to an FTP thru the web. I have adjusted a lot of the php.ini settings to suit larger files. My problem is that it seems to work fine in Firefox but not in Safari. Safari will just hang there and the file will never reach the ftp. I've tried clearing the cache, still no luck. Any ideas?
  13. I've tried editing both a php.ini template as well as one I created with just the edited values I need, both resulted in a page that says the following: This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. I have never adjusted the php setting from the server side and am pretty much learning by doing... Any help would be great.
  14. I've contacted the host and asked them to adjust the settings accordingly. Is there a way I can do it on my own? I do not have backend access just basic ftp login abilities. The server is: Microsoft-IIS/5.0
  15. I am struggling with getting this script to work. The idea is to have clients upload their large files via a web based site to our in house FTP server. I have gotten it to work error free with file sizes up to approx. 6.7mb. Which leads me to believe its an issue with file size restrictions. I have added the lines Ini_set("upload_max_filesize","1000M"); and Ini_set("post_max_size","1000M"); but still receive the below error. Notice: Undefined index: submit in E:\www\mymarketinglab.com\clientlogin\general\upload-file.php on line 63 Notice: Undefined index: submit in E:\www\mymarketinglab.com\clientlogin\general\upload-file.php on line 70 Any ideas what could cause this? <? Echo "<!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=UTF-8' /> <meta http-equiv='cache-control' content='no-cache'> <meta http-equiv='pragma' content='no-cache'> <title>Portal</title> <!--CSS--> <link href='../assets/css/style.css' type='text/css' rel='stylesheet' title='print' media='screen' /> <!--JAVASCRIPT--> <!--[if lte IE 6]> <script src='http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js' type='text/javascript'></script> <![endif]--> </head> <body> <div id='layout'> <div id='layout-top'> <div id='top-nav'> <p><a href='upload.php'>« BACK</a> | <a href='../logout.php'>LOGOUT</a></p> </div><!--top-nav end--> </div><!--layout-top end--> <br class='clear' /> <div id='layout-header'> <div class='mlab-type' align='center'><img src='../assets/images/mlab-logo-original-trans.png' alt='Logo' /></div> </div><!--layout-header end--> <div id='layout-content'> <div id='content-top'></div> <div id='content-middle'> <div align='center'> <img src='../assets/images/label-thankyou-trans.png' alt='Thank You' style='margin:0 auto;' /> "; //uses $_FILES[] global array //see manual for older PHP version info //This function will be used to get the extension from the filename Function get_extension($file,$length=-1){ $p = strrpos($file,"."); $p++; If($length!=-1){ $ext = substr($file,$p,$length); } If($length==-1){ $ext = substr($file,$p); } $ext = strtolower($ext); Return $ext; } //reset time limits to not time out on larger files Ini_set('max_execution_time',0); Ini_set('max_input_time',0); Ini_set('set_time_limit',0); ?> <? //check to see if we have submited yet If($_POST["submit"]!="submit"){ //not yet so lets make the form ?> <? } //see if we have submited and that the files array has been set If(($_POST["submit"]=="submit")&&(is_array($_FILES['userfiles']))){ $ftp_user_name="username"; //change to ftp username $ftp_user_pass="password"; //change to ftp password $ftp_server="11.111.111.111"; //change to ftp url $ftp_dump_dir="/upload-general"; //change to destination directory //Not good practice, but here anyway //change to suit your needs //also some have to be set in the ini //for this to correctly work //2meg max Ini_set("upload_max_filesize","1000M"); //turn on file uploads Ini_set("file_uploads","1"); //set your temp dir Ini_set("upload_tmp_dir","/tmp"); //set post size large enough to accomidate //3 100meg files and some overhead Ini_set("post_max_size","1000M"); //go through all the files For($x=0;$x<count($_FILES['userfiles']['name']);$x++){ //now we do some file checking //check to see if file is there If($_FILES['userfiles']['name'][$x]!="none"){ //file has a name //check filesize If($_FILES['userfiles']['size'][$x]!=0){ //file is larger than 0 bytes //Check to see if it is uploaded If(is_uploaded_file($_FILES['userfiles']['tmp_name'][$x])){ //file has been uploaded! //let the user know their file has be uploaded Echo "<p>".$_FILES['userfiles']['name'][$x]." uploaded successfully!</p>"; //conect to ftp server $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection If ((!$conn_id) || (!$login_result)) { Echo "<p>FTP connection has failed!</p>"; Echo "<p>Attempted to connect to $ftp_server for user $ftp_user_name</p>"; Exit; } else { //Echo "<p>Connected to $ftp_server!</p>"; //set PASV mode If(!ftp_pasv($conn_id,TRUE)){ Echo "<p>Could not enter PASV mode!</p>"; } //rename to file#_date.Ext $filename = $_FILES['userfiles']['name'][$x]; //$filename.= ".".Get_extension($_FILES['userfiles']['name'][$x],3); //change directory If (@ftp_chdir($conn_id, $ftp_dump_dir)) { //maybe you want to make sure we are in the correct directory //Echo "Current directory is now : ", ftp_pwd($conn_id), "\and"; } else { //you want to know if it didn't work Echo "Couldn't change directory\and"; } //upload the file and let the user know what happened If(ftp_put($conn_id,$filename,$_FILES['userfiles']['tmp_name'][$x],FTP_BINARY)){ //Echo "<p>File ".$_FILES['userfiles']['name'][$x]." was sent successfully</p>"; //Echo "<p>File was named ".$filename."</p>"; }else{ Echo "There was a problem sending file ".$_FILES['userfiles']['name'][$x]."<br>";; } } // close the FTP stream Ftp_close($conn_id); } Else echo"<p>File was not uploaded!</p>"; } } }//end for loop Echo "<p class='back'><a href='upload.php'>«Back</a></p>"; } Echo "</div> </div><!--content-middle end--> <div id='content-bottom'></div> </div><!--layout-content end--> </div><!--layout end--> </body> </html>"; ?> Thanks!!
  16. Ok, now I'm getting these two errors on any file over 6.7mb (largest I tested that worked) Notice: Undefined index: submit in E:\www\###\clientlogin\general\upload-file.php on line 81 Notice: Undefined index: submit in E:\www\###\clientlogin\general\upload-file.php on line 88 Line 81 If($_POST["submit"]!="submit"){ Line 88 If(($_POST["submit"]=="submit")&&(is_array($_FILES['userfiles']))){ Numerous files below 6.7mb have worked. I also have these lines in the file: Ini_set("upload_max_filesize","1000M"); Ini_set("post_max_size","1000M"); Any ideas what could be causing this??
  17. Safe mode is listed as off in the phpinfo()
  18. I'm building a script that will upload files from a form to an separate FTP site. The files that will be uploaded are large, 10mb and larger. I keep running into this error: Fatal error: Maximum execution time of 30 seconds exceeded in E:\www\########\clientlogin\general\upload-file.php on line 35 I have added the following lines of code in hopes it will override the :30 second limit but no luck. Ini_set('max_execution_time',0); Ini_set('max_input_time',0); Ini_set('set_time_limit',0);
  19. BTW, this is line 49 $contents = ftp_nlist($conn_id, "/download-general"); // replace dot with your dir
  20. Below is an updated script I have been working with but receive the following error after hanging for about a minute. Fatal error: Maximum execution time of 30 seconds exceeded in E:\www\mymarketinglab.com\securelogin\general\download.php on line 49 <?php // set up basic connection $conn_id = ftp_connect('12.123.123.123'); $ftp_user_name="username"; //change to ftp username $ftp_user_pass="password"; //change to ftp password // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // get contents of the current directory $contents = ftp_nlist($conn_id, "/download-general"); // replace dot with your dir // TASK: display a directory listing with thumbnails for images and human-readable filesizes // handy humansize function: // input is number of bytes, output is a "human-readable" filesize string function humansize($size) { // Setup some common file size measurements. $kb = 1024; // Kilobyte $mb = 1024 * $kb; // Megabyte $gb = 1024 * $mb; // Gigabyte $tb = 1024 * $gb; // Terabyte if($size < $kb) return $size."B"; else if($size < $mb) return round($size/$kb,0)."KB"; else if($size < $gb) return round($size/$mb,0)."MB"; else if($size < $tb) return round($size/$gb,0)."GB"; else return round($size/$tb,2)."TB"; } // output $contents print_r($contents); ?> <br /> <ul class="file-list"> <?php $d = dir($path); $icon = ''; while (false !== ($entry = $d->read())) { if ( substr($entry, 0, 1)=='.' ) continue; // get size $size = filesize($path.'/'.$entry); $humansize = humansize($size); // find filename extension $dotpos = strrpos($entry, '.'); if ($dotpos) { $ext = substr($entry, $dotpos+1); if ($ext === 'jpeg' || $ext === 'jpg' || $ext === 'gif' || $ext === 'png' || $ext === 'pdf' || $ext === 'psd' || $ext === 'ai') { $icon = "<img src='$path/$entry' style='width:48px; height:auto; vertical-align:text-top; margin:0 4px 8px 0;' alt='' title='$entry' />"; } } print "<li>$icon <a href='$path/$entry'>$entry</a> <span class='file-size'>($humansize)</span></li>\n"; $icon= ''; } $d->close(); ?> </ul>
  21. I have used this script in the past and it has worked on a local server. How would I set the below script to connect to and display files from a separate ftp? <?php // TASK: display a directory listing with thumbnails for images and human-readable filesizes // handy humansize function: // input is number of bytes, output is a "human-readable" filesize string function humansize($size) { // Setup some common file size measurements. $kb = 1024; // Kilobyte $mb = 1024 * $kb; // Megabyte $gb = 1024 * $mb; // Gigabyte $tb = 1024 * $gb; // Terabyte if($size < $kb) return $size."B"; else if($size < $mb) return round($size/$kb,0)."KB"; else if($size < $gb) return round($size/$mb,0)."MB"; else if($size < $tb) return round($size/$gb,0)."GB"; else return round($size/$tb,2)."TB"; } // get local directory path $path = "lgl-down"; ?> <!--<br /> <h3>Files in <?php print $path; ?>:</h3>--> <br /> <ul class="file-list"> <?php $d = dir($path); $icon = ''; while (false !== ($entry = $d->read())) { if ( substr($entry, 0, 1)=='.' ) continue; // get size $size = filesize($path.'/'.$entry); $humansize = humansize($size); // find filename extension $dotpos = strrpos($entry, '.'); if ($dotpos) { $ext = substr($entry, $dotpos+1); if ($ext === 'jpeg' || $ext === 'jpg' || $ext === 'gif' || $ext === 'png' || $ext === 'pdf' || $ext === 'psd' || $ext === 'ai') { $icon = "<img src='$path/$entry' style='width:48px; height:auto; vertical-align:text-top; margin:0 4px 8px 0;' alt='' title='$entry' />"; } } print "<li>$icon <a href='$path/$entry'>$entry</a> <span class='file-size'>($humansize)</span></li>\n"; $icon= ''; } $d->close(); ?>
  22. Here is what I have been experimenting with but am unsure how to correctly make the code goto the desired page. <?php $usernames = array("user1", "user2", "user3", "user4"); $passwords = array("pass1", "pass2", "pass3", "pass4"); $page = array("mypage1.php", "mypage2.php", "mypage3.php", "mypage4.php"); for($i=0;$i<count($usernames);$i++){ $logindata[$usernames[$i]]=$passwords[$i]; } if($logindata[$_POST["username"]]==$_POST["password"]){ session_start(); $_SESSION["username"]=$_POST["username"]; header('Location: '.$page); exit; }else{ header('Location: login.php?wrong=1'); exit; } ?>
  23. Each page will be completely unique (ie branded for each individual client). I have found plenty of php login scripts but none that give you the option to change the successful login page based on the user that has logged in.
  24. I will be setting up 5 users and each one will be taken to a unique page. I'm not very familiar with coding php from scratch so if anyone could point me in the direction of something that has already been done that would be awesome. 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.