Jump to content

waverider

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

waverider's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote]If you want to pass the value of the variable $description, then use this line instead: Code: <input type="hidden" name="description"  value="<?php echo $description; ?>">[/quote] Thanks Ken - that's exactly what I wanted - I thought that's where the problem was but wasn't sure how to resolve it - fixed now :-)
  2. Thanks again for the help, Code I am using to retrieve and send the Email is as follows ( I have left out all the error checking and security stuff as I have tried everything with this commented out and still get the same result) - I have also changed to POST as you suggested and everything but the one variable works with that: [quote]<?php $to      = "my@emailaddress.com"; $subject = $_POST["realname5"]; $item = $_POST["description"]; $body = $_POST["postal5"]; $email = $_POST["email"]; $name = $_POST["realname5"]; $phone = $_POST["phone5"]; $headers = "From: $email"; mail($to, $subject, "Name:  $name\nEmail:  $email\nTelephone:  $phone\nItem of Interest:  $item\nMessage:  $body", $headers); header( "Location: http://www.mywebsite/thankyou.htm" ); ?> [/quote]
  3. [quote author=willfitch link=topic=100835.msg398395#msg398395 date=1153108285] My first guess would to first ensure that the description hidden field is within the <form> </form> tags.  If it is, try using $_POST['description'] rather than REQUEST.  It's safer. [/quote] Thanks for the reply Yes it is within the form tags.  Thanks for the suggestion re: $_POST and security, however making this change won't resolve the problem of passing the variable value will it?
  4. Hello, I am trying to pass a variable from a PHP page containing an HTML form, using a hidden field, to another PHP page which then sends an Email comtaining the data passed. All other fields are passed OK,  retrieved using the structure [quote]$item = $_REQUEST["description"];[/quote]  and sent successfully in the Email. However the hidden field doesn't pass the value of the variable successfully. The hidden field structure is as below: [quote] <input type="hidden" name="description"  value="$description">[/quote] The variable $description exists, but of course what is passed to the next page is '$description' rather than it's value.  How do I pass the value of the variable rather than it's name to the next page? I have tried  passing it in the url through: [quote]<form method="post" action="http://www.mywebsite.com/mowers_query_mail.php?description=$description">[/quote] but this doesn't appear to work either. Any thoughts? Thanks
  5. One more problem: When I call the variable from the form page using: [quote]<?           urldecode($_GET['description']);           echo $description; ?>[/quote] I get [quote]{urlencode(my data here)}[/quote] What should I use to return just the data? Thanks
  6. It looks like I may have solved this.  It appears that urlencode() doesn't like the form $story['description'] so I have placed the data in a standard variable and called this with ?description={urlencode($description)} which works great - thanks for the assistance
  7. Thanks hitman6003, As soon as I put the code ?description={urlencode($story['description'])} into the link all I get is a blank page - remove the code again and things are back to normal ?  I have checked that there are no extra spaces etc I have also tried with a number of small variables to remove size as an issue. And - yes- I must replace all that with css - next job .
  8. Hello, I have a web page which draws product data from MySql and prints each product's information from an array in seperate tables created on the fly. Each iteration produces a new table with different product data. Each table has a link to a generic form which is activated through javascript in the link.  Code for display of each table as below: [quote]echo <<<BLOCK   </td>           <td width="20%" height="20" align="left" valign="top" bgcolor="#444444"><div align="left"><strong><font color="#999900" size="2" face="Arial, Helvetica, sans-serif">{$story['make']}</font></strong></div></td>           <td width="43%" height="20" align="left" valign="top" bgcolor="#444444"><strong><font color="#99CC00" size="2" face="Arial, Helvetica, sans-serif">{$story['model']}</font></strong></td>           <td width="20%" height="20" align="left" valign="top" bgcolor="#444444"><strong><font color="#99ff00" size="3" face="Arial, Helvetica, sans-serif">{$story['price']}</font></strong></td>         </tr>         <tr>           <td colspan="2" bgcolor="#444444"><font face="Arial, Helvetica, sans-serif">{$story['description']}</font></td>   <td width="20%" align="center" bgcolor="#444444"><strong><font color="#ffcc00" size="5" face="Arial, Helvetica, sans-serif"> ?<br /> <strong><font color="#999900" size="1" face="Arial, Helvetica, sans-serif"><a href="javascript: newWindow('http://www.mysite.com/contact.php')">CLICK HERE</font></strong></td>       </tr> </table> BLOCK;[/quote] I would like to pass the data from [color=green]$story['description'][/color]through the URL to the form and print it on the form.  How can I do this so that on each iteration stores the correct value of the variable for that particular product in the URL? Thanks
  9. Any ideas? Please I have now added: or die("can't connect: ".imap_last_error()); to the imap_open() part of the script and now get the message: Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost/imap:143}INBOX in /home/*****/public_html/imap_test2.php on line 9 can't connect: Can not authenticate to IMAP server: AUTHENTICATE LOGIN failed
  10. Hello, Having trouble logging on to hosting company's shared server using IMAP. The webmail program I am using in the root of my site won't log on and I can't log on with a testing script either. They insist the extensions are installed correctly as HORDE and Squirrelmail work OK. PHP v 5.1.4 IMAP c-client version 2004 I have used the test script below loaded into the root of the domain and get the message: Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:143/imap/notls}INBOX in /home/*****/public_html/imap_test2.php on line 10 Warning: imap_check(): supplied argument is not a valid imap resource in /home/*****/public_html/imap_test2.php on line 13 .... .... .... Is there something wrong with the script, am I unable to run it from the root of my domain, or is there something else such as the server not allowing this? <HTML> <HEAD> <TITLE>imap_check</TITLE> </HEAD> <BODY> <? //check for new messages $mailbox = imap_open("{localhost/imap:143}INBOX", "myname@mydomain.com","mypassword"); // Check messages $check = imap_check($mailbox); print("<PRE>"); print("Date most recent message : " . $check->Date); print("<BR>"); print("Connection type : " . $check->Driver); print("<BR>"); print("Name of the mailbox : " . $check->Mailbox); print("<BR>"); print("Number of messages : " . $check->Nmsgs); print("<BR>"); print("Number of recent messages : " . $check->Recent); print("<BR>"); print("</PRE>"); // show headers for messages $index=1; $header = imap_header($mailbox, $index); print("<PRE>"); print("Header Date : " . $header->Date . "<BR>"); print("Header To : " . $header->to) . "<BR>"; print("Header From : " . $header->From . "<BR>"); print("Header cc : " . $header->cc . "<BR>"); print("Header ReplyTo : " . $header->ReplyTo . "<BR>"); print("Header Subject : " . $header->Subject . "<BR></PRE>"); print("<PRE>"); print(imap_body($mailbox,$index)); print("</PRE><HR>"); imap_close($mailbox); ?> </BODY></HTML>
  11. Problem solved - it was password encription length.
  12. Hello' I have just swapped to a new host and a section of script no longer works. I think the problem is in the script below - using php 5.05 with the new host - 4.6 with the old one. The relevant functions are listed below the script. The script returns 'The password you entered is incorrect' but user names and passwords in the database appear to be OK. Any assistance would be appreciated. Thanks. <?php include('include_fns.php'); if ( (!isset($HTTP_POST_VARS['username'])) || (!isset($HTTP_POST_VARS['password'])) ) { print 'You must enter your username and password to proceed'; exit; } $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; if (login($username, $password)) { $HTTP_SESSION_VARS['auth_user'] = $username; header('Location: '.$HTTP_SERVER_VARS['HTTP_REFERER']); } else { print 'The password you entered is incorrect'; exit; } ?> ------------------------------------------------------------------------------------------ <?php function login($username, $password) // check username and password with db // if yes, return true // else return false { // connect to db $conn = db_connect(); if (!$conn) return 0; $result = mysql_query("select * from writers where username='$username' and password = password('$password')"); if (!$result) return 0; if (mysql_num_rows($result)>0) return 1; else return 0; } function check_auth_user() // see if somebody is logged in and notify them if not { global $HTTP_SESSION_VARS; if (isset($HTTP_SESSION_VARS['auth_user'])) return true; else return false; } function db_connect() { $result = @mysql_connect('localhost', 'db_user', 'password'); if (!$result) return false; if (!@mysql_select_db('db_name')) return false; return $result; } ?>
×
×
  • 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.