Jump to content

priyankabhar

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

priyankabhar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I am building a website in my localhost using WAMP. I have few folder down the main project folder. And now, I have to include a file from another folder which is 2 steps higher. I used $_SERVER['DOCUMENT_ROOT'] to get the website root folder. However, I only get . I need to get . How do I get this so that I can include a file from the folder and from folder. I want to use absolute paths to avoid rewriting every time I change the directory structure. Any suggestions would be appreciated. It seems include does not allow urls to be used and needs file paths. Thanks a lot! Priya
  2. Hello all, I am in great confusion. I have a form in my contact us page where I validate email address before sending the form data. Form data is sent after the user hits submit button. When I type "1" for email address and hit the submit button, I get message telling "not valid email address" and the message is not sent. But I keep getting emails from the contact us page from someone with name = "1" and email address = "1". I use following to compose message. $name = $_REQUEST['userName']; $email = $_REQUEST['userEmail'] ; $message = $name . "<p>" . $email . "</p>" . "<p>" . $_REQUEST['userMessage'] . "</p>" ; I use following to validate email address. var x=document.getElementById("userEmail").value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert("Not a valid e-mail address"); return false; } The code should be working correctly because when I test, it works fine. However, I am still getting blank emails from anonymous persons through the contact us page, and the email address the person uses is "1". Please shed some light on it. Thanks a lot, Priyanka
  3. Hi ym_chaitu, Here is my code:- ini_set("SMTP","smtp.utah.edu"); ini_set("sendmail_from","u0123456@utah.edu"); $message = 'Hi There'; $header = 'From: u0123456@utah.edu'; $subject = "Feedback Form Results"; $send=mail("u0123456@utah.edu", $subject, $message, $header); Thanks for taking the time to help me out here. smtp.utah.edu is the mail server. The error I am getting is:- Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.utah.edu" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Priya
  4. Thank you all for your suggestions. But I still get the same error. My php_ini has 25 as SMTP port. I checked using helo in telnet to localhost at 25, and it replied back with "Hello localhost". So I think port 25 is open. I also changed sendmail_from = me@localhost, but it is still not working. Please tell me if my syntax is wrong. Thanks again a lot in advance. Priya
  5. Hi All, I am facing a problem which I am not able to solve even after googling for quite some time. So if you could help me, I would be very grateful. I am trying to email using mail() function. I installed "Free SMTP Server" and it is up running. I have following code:- $message = 'Hi There'; $header = 'From: myemail@gmail.com'; //From header is must $subject = "Feedback Form Results"; $send=mail("myemail@gmail.com", $subject, $message, $header) or die("failure"); However, I get following error:- Warning: mail() [function.mail]: SMTP server response: 550 Invalid recipient: myemail@gmail.com My php.ini has following:- [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = you@yourdomain I am using WAMP server to test the website locally. I am lost here and not sure what is going wrong. It is very important for me to code this email function correctly, but I am not able to. I am looking for your ideas and help. Thanks a lot! Priya
  6. I am pretty new to php, so I could not understand your code clearly. Still looking for help.
  7. Hi All, I have my php to print out table for me, and each row data in the table is a link. I have done this much. Now, in the next step, I need to be able to click a link from the table and another table with some information about the link is supposed to appear at the bottom of the same page. I am not sure how I can use php to know which table row data (link) I clicked, so that the corresponding information can be echoed out on the new table below. <tr> <td> <?php echo $movieCounter ?> </td> <td> <div id="movieLink"><a href="#MovieSection"> <?php echo $movieName ?></a></div></td> <td> <div id="movieLink"><a href="#"><?php echo $movieID ?> </a></div></td> <td> <?php echo $movieStatus ?> </td> </tr> This is how the link is created. It is inside a for loop. So there are 5 links ( 5 movie names) that will be created. I need to be able to click on a movie name, and the corresponding informations about the movie should appear in the bottom. I am not sure how I can trace which movie name was clicked so that I could fetch its information from database? Any help would be greatly appreciated. Thanks a lot. Priya
  8. Hi, I am trying to insert data into a table, but I am not able to insert it. I wanted to see what the error was using mysql_error() function, but it does not return any error string for me. I have pasted the code below. Any ideas where I am going wrong would be greatly appreciated. global $error; $link = mysqli_connect('localhost','root',''); if($link) { $dbName = 'movieStore'; if(mysqli_select_db($link, $dbName)) { $query = "INSERT INTO Movie(movieName,movieID, movieDescription) VALUES ('$movieName', '$movieID', '$movieDescription')"; $result = mysqli_query($link, $query); if($result) { $error = "Movie: $movieName successfully created"; } else { $error = "Error in your SQL: $query"; echo mysql_error(); } } else { $error = "Unable to connect to $dbName"; } } } echo $error; It echoes that "Error in your SQL:INSERT INTO Movie(movieName,movieID, movieDescription) VALUES ('gg', '1', '') " However, it does not print our what the error was while inserting. Thanks a lot for looking into this. Priya. It echo's that
  9. Thanks a lot Rajiv. It may sound stupid question, but which one is better? I mean, is using mysql from Wamp Server as effective as the mysql that I can download separately on my machine? Thanks, Priya
  10. Hi All, I need to connect to mysql database from my php script . I am using wamp server. I am new to php, netbeans and wamp. Can I use the mysql that comes with wamp server or should I download separate mysql? Thanks a lot, Priya
  11. Thanks for replying chrisdburns. But I want to display the html page returned by server side php in the div tag of the client side html page. I get an entirely new html page from the server, but I want to display the php response in the div tag of the html page. Thanks!!!
  12. Hi All, I want to display the results of PhP query into my existing html page which has a div area for the results to display. With JavaScript, we can get the div area and then insert the html into it. But I am not sure how we can do that with php. Please give my any idea/suggestions. Thanks a lot.
×
×
  • 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.