Jump to content

kee2ka4

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Posts posted by kee2ka4

  1. Hello everyone,

     

    I need some help to convert a string and display it as a hyperlink on a page. Bascially I have a "comments" field in a database that is of type "text". When I display the string on a page, it doesn't display hyperlink text as a hyperlink. So say for example I have a comment that says "Go and check out this link: http://domain.com", The page will display this as a simple text without no hyperlink. How can I display http://domain.com as a hyperlink. Is there any function over there that would help me solve my problem?

     

    Thanks,

    Ket

  2. My Server Root Path is /home/kingket/public_html and I simple want to load the index.php file that is located in the tumblelog directory.

     

    So /home/kingket/public_html/tumblelog/index.php and I want the htaccess code to display the index.php in the following format:

     

    /home/kingket/public_html/tumblelog/

     

    But when I remove the base rewite code "RewriteBase tumblelog/", it loads but I have to manually put the forward slash after the tumblelog and when I include the base rewite code it doesn't seem to work. Is there anyone out there who has knowledge of htaccess, I have little server knowledge and really don't have a clue how to solve this..

     

    Thanks

  3. Hi, thanks for your reply, I guess its just not having it today, lololz, I used your code but now I get the following error:

     

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

     

    Please contact the server administrator, webmaster@kingket.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

     

    More information about this error may be available in the server error log.

     

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  4. Hi, Thanks for your reply. I have changed the htaccess file to NC,L at the end so now my htaccess file has:

    RewriteEngine On

    RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|^public/.*)$ /index.php [NC,L]

     

    But when I edit the code to the above, it doesn't display any of the pages. So when I go to:

     

    http://www.kingket.com/tumblelog/ (with or without the forward slash), I get the following error:

    Not Found

    The requested URL /index.php was not found on this server.

     

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

     

    And I do have the index file in the tumblelog directory... Any clues?

  5. I have no idea what I have done wrong here, its took my 3 whole days and I still don't have a clue. Here is my weblink,

     

    http://www.kingket.com/tumblelog/

    The above link only loads if I manually put in the forward slash at the end of the tumblelog directory, but if I remove the last forward slash, then I get the following error:

    Bad Request

    Your browser sent a request that this server could not understand.

     

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

     

    I have figured out that the .htaccess file in the tumblelog directory is creating the problem cause when I remove the file, it automatically places the forward slash. But I need the code in .htaccess for userfriendly urls.

     

    Here is the code I have in the .htaccess file:

    RewriteEngine On
    RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|^public/.*)$ /index.php [nocase,last]

     

    One more thing also I have noticed that my redirect_to function doesn't redirect the user corrently, so say if I login and press the submit button, it doesn't redirect the user to the appropriate page. I have to manually enter the link and then it works.

     

    All this works fine on my localhost.

     

    Could someone please help me out here..

     

    Thanks

     

     

  6. Hi! I have a login script that I want to use for my website. Bascially the Login Script requires the UserID and the Password for the user to Login, and this script works fine when I enter the userid and password..

    However I need a login script to take the users Email address and Password to login therefore I have edited all the variables and stuff so that the form takes the email address instead of the User id however I keep getting the following sql error message:

    [b]Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@hotmail.com' at line 1[/b]

    The code for this login script is:

    [code]<?php
    header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
      header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
    header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
    header ("Pragma: no-cache");                          // HTTP/1.0
    session_start();

    if (!isset($_SESSION['SESSION'])) require ( "../../include/session_init.php");

    // reset session variables...
    $_SESSION['USERID'] = "";
    $_SESSION['LOGGEDIN'] = false;
    $_SESSION['EMAIL'] = "";
    $_SESSION['FNAME'] = "";
    $_SESSION['LNAME'] = "";

    // initialize variables...
    $userid = "";
    $passwd = "";
    $email = "";

    // make sure post parameters were sent...
    if (isset($HTTP_POST_VARS["email"])) $email = addslashes($HTTP_POST_VARS["email"]);
    if (isset($HTTP_POST_VARS["passwd"])) $passwd = addslashes($HTTP_POST_VARS["passwd"]);

    $_SESSION['EMAIL'] = $email;

    // form variables must have something in them...
    if ($email == "" || $passwd == "") { header("Location: ../login_system.php?flg=red&email=".$email); exit; }

    // check in database...
      $query = "SELECT * FROM tbl_users WHERE cEmail = ".$email;

    //echo $query;
      mysql_pconnect($_SESSION['MYSQL_SERVER1'],$_SESSION['MYSQL_LOGIN1'],$_SESSION['MYSQL_PASS1'])
                      or die("Unable to connect to SQL server");
        mysql_select_db($_SESSION['MYSQL_DB1']) or die("Unable to select database");
     

    $result = mysql_query($query) or die("Invalid query: " . mysql_error());

    // if userid is not present in DB go back to login page...
    if (mysql_affected_rows() != 1) { header("Location: ../login_system.php?flg=red&email=".$email);; exit; }

    // check for password, active state, user type, and then send to appropriate section...
    if ($row = mysql_fetch_assoc($result)) {
    // echo $row['sPassword'] . "<br>" . md5($passwd);
    if (strcmp($row['sPassword'], md5($passwd)) != 0) { header("Location: ../login_system.php?flg=red&email=".$email); exit; }

    // set standard session variables...
    $_SESSION['LOGIN_TYPE'] = $user_type;
    $_SESSION['USERID'] = $userid;
    $_SESSION['EMAIL'] = $email;
    $_SESSION['LOGGEDIN'] = true;
    $_SESSION['FNAME'] = $row['sFName'];
    $_SESSION['LNAME'] = $row['sLName'];

    header("Location: ../account.php");
    exit;

    } else {
    header("Location: ../login_system.php?flg=red&email=".$email); exit;
    }

    ?>
    [/code]

    Could someone Please help me... or Point me in the right direction... Regards kee2ka4
  7. Hi! Thanks for your reply.. I did try to copy and paste the whole code but the page crashes... The sql query code in the login script is: [code]$query = "SELECT * FROM tbl_users WHERE cEmail = ".$email;

    //echo $query;
      mysql_pconnect($_SESSION['MYSQL_SERVER1'],$_SESSION['MYSQL_LOGIN1'],$_SESSION['MYSQL_PASS1'])
                      or die("Unable to connect to SQL server");
        mysql_select_db($_SESSION['MYSQL_DB1']) or die("Unable to select database");
    $result = mysql_query($query) or die("Invalid query: " . mysql_error());

    // if userid is not present in DB go back to login page...
    if (mysql_affected_rows() != 1) {
    echo "Error2!<br />
        Please try again!<br />"; }[/code]

    Thanks for your help...
  8. Hello Everyone! I have a basic knowledge in php. I have got a Login Script where user can enter in their UserID (which is a numeric value) and a Password to login.

    I need a login system for my site however I need the user to enter in their email address and password. Therefore I edited the login Script changed all the variables and post values etc etc... However I keep getting the following error message::

    [quote]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@hotmail.com' at line 1"[/quote]

    Can anyone point me out in the right direction? Thanks for all the help.... ;)
  9. Yes  ;D! I have sorted out the Problem! It took me one whole day lololol ! What I did is I stopped using mail () function and instead replaced it with PHPMailer, this is a php class for sending out emails. Anyone that is having problems with mail(), go throught this tutorial, its is really helpfull...

    http://www.phpfreaks.com/tutorials/130/0.php

    Understand the PHPMailer class and then apply it into your code! If you want your webform to send emails, and do many other things, use phpmailer, it will work perfectly. The only thing u need to change is the smtp address in the php.ini file. My ISP is pipex and therefore my SMTP = smtp.dsl.pipex.com. Thats it!

    Anyways.. I am off, thanks for all the help today!

    Regards, Kee2ka4
  10. The $email_address seems to be fine cause it does successfully add the details to the database! The $email_address is the address that I enter in a form, its just a normal hotmail email account that I enter. I have even tried @yahoo.com @gmail.com and non of them work...?

    Any other cluess... if nothing works then I will have to upload it on a webhosting company, but i would really prefer to work on my localhost.... ::)
  11. Hi! Thanks for your reply wildteen.... You were right I didn't restart my server but now the error message has changed... now it says the following...

    Warning: mail() [function.mail]: SMTP server response: 501 Bad address syntax in C:\wamp\www\Car_Project\Registration\Testingtutorial\register.php on line 121


    The mail() function code on line 121 is:

    [quote] mail($email_address, $subject, $message, "From: MyDomain Webmaster<me@example.com>\nX-Mailer: PHP/" . phpversion());
    echo 'Your membership information has been mailed to your email address! Please check it and follow the directions!';
    [/quote]

    Any idea's what might be wrong?

    Cheeerss
  12. I have changed the smtp from localhost to my isp smtp address, however I still get the same error message. The settings I am changed in php.ini is:

    [mail function]
    ; For Win32 only.
    SMTP = smtp.dsl.pipex.com
    smtp_port = 25

    After changing the smtp from localhost to smtp.dsl.pipex.com I still get the same error message. The error message I get is

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Car_Project\Registration\Testingtutorial\register.php on line 121

    I have gone through many tutorials and researched google pages but didn't get anywhere... Some say to install an smtp server, I even tried that and its just not working

    Could anyone help me please? I really can't proceed without sorting this error out... Please give me some light to my problem...

    Regards,
    Kee2ka4....
  13. Hi! Thanks for all the Responses! Could anyone point me to the Direction as to how to Install an SMTP server locally? I don't even know if I have an SMTP server. Sorry I am quite new to all this.  ::)

    Btw my ISP is pipex and I am using my local host to view my php files and I am using Apache! I just want this mail() to work for me to proceed!

    Thanks..
  14. Thanks for your reply, I have looked into the mail() function in php.ini and this is what there is:

    [mail function]
    ; For Win32 only.
    SMTP = localhost

    ; For Win32 only.
    ;sendmail_from = me@example.com

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =

    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_paramaters =

    Could you tell me what I need to change in that?

    Also I have found three files with php.ini extension these are php.ini-recommended (c:\wamp\php), php.ini (c:\wamp\apache2\bin), and php.ini-dist (c:\wamp\php) do I have to change the settings in all of them?

    Thanks for your Help...
    Regards,
    Kee2ka4
  15. Hi! I am using a mail() function in one of my php code. However I have getting the following error:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Car_Project\Registration\Testingtutorial\register.php on line 121

    I am using Localhost, Could anyone please tell me what I have done wrong or what setting I am required to change...

    Thanks for any Help

    Regards,
    Keetan
×
×
  • 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.