Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Everything posted by phpretard

  1. $dirname = "ALBUMS/".$lastname; function returnimages($dirname) Somehow it produced this: Warning: Missing argument 1 for returnimages(), called in /home/content/r/e/m/rememberthe/html/pages/photos_get.php on line 47 and defined in /home/content/r/e/m/rememberthe/html/pages/photos_get.php on line 17 I did get the pictures to finaly display...now the only problem is defining the path with the code above.
  2. Now there's problem with this?? function returnimages($dirname="ALBUMS/$lastname")
  3. I appologize for not showing the rest of the script. Here it is. while($row = mysql_fetch_array($result)) { $lastname=$row['lastname']; $firstname=$row['firstname']; echo $firstname ." ". $lastname; } function returnimages($dirname="ALBUMS/$lastname") { $pattern="\.(jpg|jpeg|png|gif|bmp)$"; $files = array(); $curimage=0; if($handle = opendir($dirname)) { while(false !== ($file = readdir($handle))){ if(eregi($pattern, $file)){ echo '<br>galleryarray[' . $curimage .']=["' . $file . '"];' . "<br>"; $curimage++; } } closedir($handle); } return($files); } returnimages(); Where should I put the code you provided?
  4. Can someone help me turn this code into pictures? galleryarray[0]=["P1120081.jpg"]; galleryarray[1]=["P1120082.jpg"]; galleryarray[2]=["P1120083.jpg"]; galleryarray[3]=["P1120084.jpg"]; galleryarray[4]=["P1120085.jpg"]; galleryarray[5]=["P1120086.jpg"];
  5. Thanks for all your help! -Anthony
  6. I need to upload about 200 photos into a specific folder then access those photo for veiwing.
  7. I can upload a zip file with no issues. The problem is I need to upload and then unzip the file. Any pointers, tutorials, script... Thank you, Anthony
  8. I do now...and it works great! Thank you
  9. When I change pages it seems that the session is destroyed. Here is the code: <?php session_start(); $link=mysql_connect("secret","secret","secret"); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db=mysql_select_db("secret"); if(!$db) { die("Unable to select database"); } if(!get_magic_quotes_gpc()) { $login=mysql_real_escape_string($_POST['login']); }else { $login=$_POST['login']; } $qry="SELECT * FROM members WHERE login='$login' AND passwd='".md5($_POST['password'])."'"; $result=mysql_query($qry); while($row = mysql_fetch_array($result)) { $member_id=$row['member_id']; $firstname=$row['firstname']; $lastname=$row['lastname']; } if($result) { if(mysql_num_rows($result)>0) { session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID']=$member_id; $_SESSION['SESS_MEMBER_FNAME']=$firstname; $_SESSION['SESS_MEMBER_LNAME']=$lastname; header("location: member-index.php"); }else header("location: login-failed.php"); } }else { die("Query failed"); } ?> Can you tell why by this code? The session might not be ending but it seems to... Each time I go to a new page the form shows up again instead of member index. <? if (!isset($_SESSION['SESS_MEMBER_ID'])){ echo" <a name='login_top'></a> <form style='padding-left:10px;' id='loginForm' name='loginForm' method='post' action='#login_top'> $log_error <b>Login</b><br> <input name='login' type='text' id='login' /><br> <b>Password</b><br> <input name='password' type='password' id='password' /><br> <input style='margin-top:5px; height:23px; width:75px; font-size:10px;' type='submit' name='Login' value='Login' /> </form> "; } elseif (isset($_SESSION['SESS_MEMBER_ID'])){ include 'Login/member-index.php'; } ?> Can anyone help with this? If the session is not ending what is the best way to pass session variables from page to page?
  10. Can you echo those values ($y and $z) with out JS?
  11. I know that...I replaced - h32mysql80.servesecurer.net - with - localhost - just for posting purposes.
  12. here is the error... Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost'(4) in /home/content/t/h/e/html/connect.php on line 2 Could not connect: Can't connect to MySQL server on 'localhost'(4)
  13. <? $A="$z->item(0)->childNodes->item(0)->nodeValue"; $B="$y->item(0)->childNodes->item(0)->nodeValue"; $C="$z->item(0)->childNodes->item(0)->nodeValue"; $hint= "<a href='#' onClick='document.email.Body.value+=(" . $A . ") " . $B . "'><font color='#999999'>(" . $C . ")</font></a>"; ?> [code] [/code]
  14. Is there a setting somewhere that could prevent connection to a database from a different server? I am trying to connect to DB1 setup at Server1 from a site hosted at Server2. The code works fine from Server1 to DB1 but not from Server2 to DB1. I hope this question makes sense. Let me know if you need clarification to help I use the exact same code for both. $con = mysql_connect("thehost","Stinks","Pretty"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Stinks", $con); -Anthony
  15. This is the top of my document and the only page thus far. I have used this many times and this is the first problem I have had. Any help? <? session_start(); ?> <!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> <title>$company_name</title> <link rel='stylesheet' type='text/css' href='default.css' media='screen' /> <meta http-equiv='Content-Type' content='text/html;charset=utf-8' /> </head> Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/t/h/e/html/index.php:1) in /home/content/t/h/e/html/index.php on line 2 Thank you as always.
  16. How can pull just the first letter from a row in a DB? I need initials only from fisrt and last name. $result = mysql_query("SELECT * FROM table"); while($row = mysql_fetch_array($result)) { $initials=$row['FirstName'] . " " . $row['LastName']; echo "Initials Only"; } mysql_close($con); Thanks for your help...
  17. I have lots of records in my DB with the phone numbers in this format -2819887772 How can I echo them like this - (281) 988-7772 ? Anyone here this early / late? Thank you!
  18. Thank you very much for your advice... Any more thought would be appriciated! -Ant
  19. 10-4 Will this affect the speed of the site?
×
×
  • 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.