Jump to content

Zombies

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Zombies's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Hopefully ive sorted it I changed it to $sent = mail($_POST['to'],$_POST['subject'],$message,'FROM: '.$_POST['from']);
  2. Hi I have a website with a contact owner form, when sent and recieved the email doesnt contain the senders email but the email addrees of the site admin (me!) I've tried a few things which just leaves the from blank which I prefer for now. any ideas? Code for entering infol - echo "<p>"; echo "<a name='contact'></a>"; echo "<form action='mailme.php' method='post' target='_blank'>"; echo "<table class='detailTable' cellspacing=0 border=0 width='90%'>"; echo "<tr>"; echo "<td class='subHeader' colspan=2>Reply to Ad</td>"; echo "</tr>"; echo "<tr>"; echo "<td width='30%'><strong>Contact</strong></td><td>".$member['FName']. " " .$member['LName']."</td>"; echo "</tr><tr>"; echo "<td>Your Email</td><td><input type='text' name='from' validate='email' required='yes' message='Enter Email Address.'></td>"; echo "</tr><tr>"; echo "<td>Subject</td><td><input type='text' name='subject' size='40' validate='text' required='yes' message='Enter Subject.'></td>"; echo "</tr><tr>"; echo "<td>Message</td><td><textarea style='width:100%;height:70px' name='message' >"; echo "Please contact me regarding the following ad: $adurl"; echo "</textarea></td>"; echo "</tr><tr>"; echo "<td> </td><td><input type='submit' onClick='validate(this.form); return document.formSubmit;' value='Send'></td>"; echo "</tr>"; echo "</table>"; echo "<input type='hidden' name='to' value='".$member['Email']."'>"; echo "<input type='hidden' name='oktosend' value='yes'>"; echo "</form>"; echo "</p>"; Code for sending the mail - $node = new sqlNode(); $node->table = 'admin'; $node->select = "*"; $node->where = "where ID = 1"; $result = $mysql->select($node) or die($mysql->debugPrint()); if(mysql_num_rows($result)<1){ die("Invalid site settings"); } $settings = mysql_fetch_assoc($result); $message = "Reply To: ".$_POST['from']."\n".$_POST['message']; $sent = mail($_POST['to'],$_POST['subject'],$message,'FROM: '.$settings['Email']); if($sent){ echo "<script>alert('Message Sent');window.close();</script>";
  3. Managed to do the same in edit.php as well so it doesnt appear whilst editing et viola Thanks
  4. Thanks, almost but ('\r\n', "\r\n" did the trick thing is, when you go back to edit it displays \r\n\r\n\ within the edit section (not the display section, it displays ok now) It'll do for now tho thanks a lot if you can think of a way to do it at source let me know thanks again
  5. There is data already there and is editable echo "<h4>Edit Ad</h4>"; echo "<form action='edit2.php' method=post>"; echo "<table cellpadding=2 cellspacing=0 width='90%'>"; echo "<tr >"; echo "<td colspan=2 class='subHeader'>*Fields will validate on submit</td>"; echo "</tr>"; FROM EDIT2.php if($_POST['TypeID'] != ""){ //verify type id $sql = sprintf("select * from types where ID = %s", intval($_POST['TypeID'])); $result = $mysql->exSql($sql) or die($mysql->debugPrint()); if(mysql_num_rows($result)<1){ die("<script>window.location='logout.php';</script>"); } //Fetch fields types to insert $node = new sqlNode(); $node->table = "customfields"; $node->select = "*"; $node->where = "where TypeID = ".intval($_POST['TypeID']); $node->orderby = "group by GroupID order by `Order` asc"; if( ($result = $mysql->select($node)) === false ) die($mysql->debugPrint()); $node = new sqlNode(); $node->table = sprintf("`tt_%s`", abs(intval($_POST['TypeID']))); $fetchLatLong = false; while($field = mysql_fetch_assoc($result)){ if( ($field['Title'] != "Latitude") && ($field['Title'] != "Longitude") ){ if($field['Type'] == 'checkbox') $node->push("text",$field['Title'],@implode(',',$_POST[str_replace(" ","_",$field['Title'])])); else{ if($field['AllowHTML'] == 'no'){ $node->push("text",$field['Title'],strip_tags($_POST[str_replace(" ","_",$field['Title'])])); } else{ $node->push("text",$field['Title'],$_POST[str_replace(" ","_",$field['Title'])]); } } } if($field['Title'] == "Latitude") $fetchLatLong = true; } if($fetchLatLong){if($_POST['TypeID'] != ""){ //verify type id $sql = sprintf("select * from types where ID = %s", intval($_POST['TypeID'])); $result = $mysql->exSql($sql) or die($mysql->debugPrint()); if(mysql_num_rows($result)<1){ die("<script>window.location='logout.php';</script>"); } //Fetch fields types to insert $node = new sqlNode(); $node->table = "customfields"; $node->select = "*"; $node->where = "where TypeID = ".intval($_POST['TypeID']); $node->orderby = "group by GroupID order by `Order` asc"; if( ($result = $mysql->select($node)) === false ) die($mysql->debugPrint()); $node = new sqlNode(); $node->table = sprintf("`tt_%s`", abs(intval($_POST['TypeID']))); $fetchLatLong = false; while($field = mysql_fetch_assoc($result)){ if( ($field['Title'] != "Latitude") && ($field['Title'] != "Longitude") ){ if($field['Type'] == 'checkbox') $node->push("text",$field['Title'],@implode(',',$_POST[str_replace(" ","_",$field['Title'])])); else{ if($field['AllowHTML'] == 'no'){ $node->push("text",$field['Title'],strip_tags($_POST[str_replace(" ","_",$field['Title'])])); } else{ $node->push("text",$field['Title'],$_POST[str_replace(" ","_",$field['Title'])]); } } } if($field['Title'] == "Latitude") $fetchLatLong = true; } if($fetchLatLong){
  6. Hi Thanks for taking the trouble to help on this but I did a search for INSERT INTO and found that code, its actually from the backup section!! sorry about that, I cannot seem to find any others what else can i search for within the script?
  7. This any good? //fetch db tables $tables = mysql_list_tables($database_myconn,$myconn); //for each table found while($tbl_row = mysql_fetch_row($tables)){ // Dump data $table = $tbl_row[0]; unset($data); $data = 'truncate table `'.$table.'`; '; $result = mysql_query("SELECT * FROM `$table`"); $num_rows = mysql_num_rows($result); $num_fields = mysql_num_fields($result); for ($i = 0; $i < $num_rows; $i++) { $row = mysql_fetch_object($result); $data .= "INSERT INTO `$table` ("; // field names for ($x = 0; $x < $num_fields; $x++) { $field_name = mysql_field_name($result, $x); $data .= "`{$field_name}`"; $data .= ($x < ($num_fields - 1)) ? ", " : false; } $data .= ") VALUES ("; // Values for ($x = 0; $x < $num_fields; $x++) { $field_name = mysql_field_name($result, $x); $data .= "'" . str_replace('\"', '"', mysql_escape_string($row->$field_name)) . "'"; $data .= ($x < ($num_fields - 1)) ? ", " : false; } $data.= ");\n "; }
  8. Thanks in blue I imagine is the section where its entered, hope this helps while( $field = mysql_fetch_assoc($result) ){ if($field['Type'] != "Mapping"){ switch($field['Type']){ case "text": echo "<tr>"; echo "<td valign='top' width='20%'><strong>".$field['Title']."</strong></td>"; echo "<td >"; if( ($field['MaxChars']*1) > 0 ) $maxlen = $field['MaxChars']; echo "<input type='text' maxlength='$maxlen' name='".$field['Title']."' value='".$listing[$field['Title']]."' validate='".$field['Validate']."' required='".$field['Required']."' message='".$field['Message']."'>"; break; case "textarea": echo "<tr>"; echo "<td valign='top'><strong>".$field['Title']."</strong></td><td>"; if( ($field['MaxChars']*1) > 0 ){ $max = $field['MaxChars']; $id = $field['Title'].'_message'; $additional_attributes = " onkeyup='check_length($max,this,\"$id\");' onChange='check_length($max,this,\"$id\");' onmouseout='check_length($max,this,\"$id\");' "; echo "<div><span id='$id'>$max</span> Characters Left</div>"; }
  9. putting in stripslashes gets rid of \ echo stripslashes(nl2br($listing[$field['Title']])); now shows rnrn just need to get rid of rn striprnrn ?
  10. Hi Thanks for your replies. I know nothing about PHP coding unfortunately so if anyone could place the code as i need it like above i'd appreciate it. Heres what happens instead of 1 2 3 456 I get 1\r\n2\r\n\r\n3\r\n\r\n\r\n456
  11. Need Help with nl2br Its placed in a file showing text and as far as I know not in a file editing. It displays r\n\r\n instead of line breaks and anywords with a ' in it places about a dozen / Any ideas guys? I will look through the threads The code = case "textarea": echo "<tr>"; echo "<td valign='top' colspan=2><div><strong>".$field['Title']."</strong></div>"; echo "<p>"; echo nl2br($listing[$field['Title']]); echo "</p>"; echo "</td>"; break;
×
×
  • 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.