Jump to content

peranha

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by peranha

  1. INSERT INTO users ('user_Id', 'userName', 'pass', 'firstName', 'lastName', 'country') VALUES ('id4a99b9563701d', 'abcd', 'abcd', 'abcd', 'abcd', 'United States') try that, it is because of the Space between Unite and States.
  2. Is mail set up in your php.ini file for the new hosting company?
  3. what you are looking for is BBcode.
  4. I want to open a directory, and get all the images in that folder and display them to the webpage No databse, just a directory of pics. Here is what I have. getimage.php page. <?php $path = "C:/pics"; //images them dir //$patha ="C:/pics"; $dh = opendir($path); while ($file = readdir($dh)) { if($file != "." && $file != "..") { $extension = substr($path, -3); if($extension == "jpg" || $extension == "jpeg"){ header("Content-type: image/jpeg"); }elseif($extension == "gif"){ header("Content-type: image/gif"); }elseif($extension == "bmp"){ header("Content-type: image/bmp"); } $path = "$path/$file"; readfile($path); } } closedir($dh); // close dir ?> Here is how it is called on the page. images1.php <?php echo "<img src='getimage.php' alt='' width=100 />"; ?> Currently it gets the first image in the directory, but every image after that, it adds the first image file name to the $path variable. example img1 = P3140722.JPG img2 = P3140722.JPG/P3140723.JPG img3 = P3140722.JPG/P3140723.JPG/P3140724.JPG etc.... Any ideas?
  5. Thanks, cant believe I forgot to set the variable on the main page.
  6. Here is my usage. <?php $profile->retrieve_username($userid); echo $username; ?> if I change the functio to <?php // Function to retrieve user name. public function retrieve_username($userid) { $ruq = mysql_query("SELECT user_name FROM " . $this->pre . "users WHERE user_id = '{$userid}'"); $r = mysql_fetch_array($ruq) or die(mysql_error()); $username = $r[0]; echo $username; } ?> "peranha" is outputted to the screen, so $username is set, just wont return with return $username. Am I not using it right?
  7. Is there a way to return a variable from a function inside a class? Ex. <?php // Function to retrieve user name. public function retrieve_username($userid) { $ruq = mysql_query("SELECT user_name FROM " . $this->pre . "users WHERE user_id = '{$userid}'"); $r = mysql_fetch_array($ruq) or die(mysql_error()); $username = $r[0]; return $username; } ?> Then I need to use the variable $username in another function. if I echo $username in the function, it will display "peranha", but if I echo $username on the page itself, it doesnt return anything.
  8. The css link goes in the head of the document. <head> <link rel="stylesheet" href="/styles.css" type="text/css"> </head>
  9. Yeah, never use short tags as this will happen, because some servers dont support it. Always use the full <?php tags.
  10. change the <? to <?php in the following code <? } elseif ($errorStr != '') { print $errorStr; } ?> I dont think that godaddy supports php short tags. I never got them to work. Also use [ code] [ /code] tags (without the space) it color codes things and makes it easier to read. Also what is the \ for here if($sent == 1 && isset($_POST['submit']) ) {\
  11. Nothing in the code should make you login twice.
  12. you need session_start(); on the page.php code as well.
  13. $sql = "SELECT RB.playerid, RB.teamid, O.week1opp FROM runningbacks RB INNER JOIN opponents O ON RB.teamid = O.teamid; try that and see what you get.
  14. w3schools read the manual at php.net. Look at the tutorials on www.phpfreaks.com/tutorials do a google search, lots of info will come up.
  15. yes that is output, it cannot be before session_start(). put session_start at the very top of the page before anything. <?php session_start(); ?> <html> <head> etc...
  16. session_start() that has to be at the top of the page before any output is sent. including blank lines.
  17. Are you getting any errors? Not sure, but I believe you need to join the tables somehow. SELECT * FROM ContentSub CS INNER JOIN Plugins P ON CS.tablefield = P.tablefield WHERE CS.Content_ID = 'PreDefinedID' AND CS.Plugin_ID = P.PluginID OR CS.Default = 'Y' AND CS.Plugin_ID = P.PluginID
  18. Apache comes with the WAMP installer, you do not install it separately.
  19. He specifically said that it was during the registration process. yeah, and he is getting the capture error for his password being invalid.
  20. Everything looks closed to me try putting this at the top of the file and see if anything displays. ini_set ("display_errors", "1"); error_reporting(E_ALL);
  21. var gallery4=new virtualpaginate({ piececlass: "virtualpage4", piececontainer: 'div', pieces_per_page: 1, defaultpage: 0, persist: true }) try changing pieces_per_page and see what that does. that is from HTML code block.
  22. if (($_SESSION["type"] != 'admin') || ($_SESSION["type"] != 'reseller')) That says if ((session type does not equal admin) or (session type does not equal reseller)) if (($_SESSION["type"] == 'admin') || ($_SESSION["type"] == 'reseller')) That says if ((session type is equal to admin) or (session type is equal to reseller))
  23. You way want to make sure that they are free from sql injections and XSS attacks so you dont get hacked.
×
×
  • 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.