Jump to content

dk4210

Members
  • Posts

    154
  • Joined

  • Last visited

Everything posted by dk4210

  1. Hi thanks for the quick response What seems to be happening is the page basically reloads itself and when it does it never displays the notification.
  2. Hello Guys, I am trying to get this js to work with my PHP form and I need some help.. I have the following form echo' <form id="form" name="form" method="post" action="index.php?content=listings&cid='.$cid2.'&id='. $id2 . '&contact=1" onsubmit="demo12"> <label> <span class="small">Name</span> </label> <input type="text" name="name" id="name" class="validate(required)" value="'.$_SESSION['fname'] .' '.$_SESSION['lname'] .'" /> <label> <span class="small">Email Address</span> </label> <input type="text" name="email" id="email" class="validate(required,email)" value="'.$_SESSION['email'] .'" /> <label> <span class="small">Comments</span> </label> <textarea id="conowntxtarea" class="validate(required) name="comments"></textarea><br /> <button id="demo12" type="submit">Send to Owner</button> <div class="spam_warning">Warning: Spam or Harrassment will not be tolerated!</div> <div class="spacer"></div> </form>'; And the following js code <script type="text/javascript"> $(document).ready(function() { $('#demo12').click(function() { $.growlUI('Growl Notification', 'Have a nice day!'); }); }); </script> I want to be able to submit the form and it activate the js script notification before it completes the form action url.. Could some one give me a hand with this? Thanks, Dan
  3. On more question for ya.. Is there a way to construct a query to grab the date range about and combine it with another table for example if I had two tables Table A |id |listing_id| start_date | end_date| Table B | listing id | listing_name | What I would like to do is query table A for * with start and end date and get the id Create a second query to grab the listing name in table b Combine the query results to show is the listing name in the csv file that I will be exporting... Did I lose you? Thanks for your help..
  4. Hello Guys, I have a question.. I am trying to query the data base for a specific date range but it's not displaying the correct date range.. Here is my query SELECT * FROM report WHERE start_date AND end_date BETWEEN '2011-08-01 00:00:00' AND '2011-08-31 00:00:00' It seems to be loading all the rows not just the date rage specified above.. Please advise.. Thanks, Dan
  5. Hello Guys, I am trying to get the the css to work but having a hard time with it and need some help.. Here is the content lined up in fire fox. Ad this is what it looks like in IE (See my issue) Here is the code echo '<div class="listing"><img src="'.$listing_photo.'"><span class="listlink"><a href="index.php?content=subcats&id='. $listing_id.'">'.$listing_title2.'</a></span><br><span class="listbody">'.$listing_body2.'<span class="readmore"><a href="index.php?content=subcats&id='. $listing_id.'"> Read more</a></span>>>></div>'; Here is the CSS .listing { width:560px; height:auto !important; margin: 0 auto; text-align: left } .listlink { float:left; margin-left: 10px; margin-top: 20px; position: absolute; text-decoration:underline; } .listbody { float: left; margin-left: 110px; margin-top: -30px; width:440px } .listingdiv{ border-bottom: 2px dotted #9EABB5; color:#FFF; } Please advise how to fix this.. Thanks for your help in advance.. Dan
  6. OK Thorpe it's almost all working except one part It should only display the ads with the ad_pcat=$cid AND approved='1' How would I add that in the current code? I tried but received an error $result = mysql_query("SELECT * FROM ads LEFT JOIN ads_photo USING (ad_id);") or die("Sql error : " . mysql_error()); //$result = mysql_query("SELECT * FROM ads WHERE ad_pcat=$cid2 AND approved='1'") or die("Sql error : " . mysql_error()); while($row = mysql_fetch_assoc ($result)){ $ad_id=$row["ad_id"]; $ad_title = $row['ad_title']; $ad_photo = $row['ad_photos']; echo "This is the ad photo" . $ad_photo; echo "<img src=\"$ad_photo\">This is the ad_title ". $ad_title."ID-$ad_id"."<br>";
  7. Thanks but I am getting the following error Sql error : Column 'ad_id' in field list is ambiguous
  8. Hello Guys, I am trying to do a some sort of join with a while loop and I am not sure how to do it.. I have 2 tables "ads" and "ads_photo" and I would like to pull the following data out of the tables ad_id and ad_title from the "ads" table The ad_photos from the "ads_photo" table the "ad_photo table id has to match the id from the "ads" table Then i need to display a while loop. Here is what I have so far $result = mysql_query("SELECT * FROM ads WHERE ad_pcat=$cid2 AND approved='1'") or die("Sql error : " . mysql_error()); while($row = mysql_fetch_assoc ($result)){ $ad_id=$row["ad_id"]; $ad_title = $row['ad_title']; echo "<img src=\"$ad_photo\">This is the ad_title". $ad_title."ID-$ad_id"."<br>"; Please advise
  9. Hi WebStyles, I tried the following / multiple recipients $to = $email; //$from2 = "someonelse@".$url.""; $from2 = $_SESSION['no_reply']; //echo "This is the from2" . $from2; //exit; // subject $subject2 = 'You have a new message from ' . $_SESSION['site_name'] .''; //begin of HTML message $message2 = 'You have a new message.<br>'; $message2 .= 'From: '. $username1; $message2 .= '<br>Message Details'; $message2 .= '<br><a href="'.$site_url .'">Log in to see the message</a>'; $message2 .= '<br><br><br>'; //end of message $headers = "From:".$from2."\r\n"; $headers .= "Content-type: text/html\r\n"; // Mail it mail($to, $subject2, $message2, $headers); And it never sent the email at all chintansshah, I tried what told me to do and it just sent the default email address.. The strange thing is if I manually add the address in there it works fine but if I try to use a variable it malfunctions in one way or another.. Please advise
  10. Hello Guys, I have a strange issue that I am trying to figure out... I have a php mail script that I can't get the correct from email address to display in the email client Here is my code notice the $from2 var If I have this code - $headers = "From:'.$from2.'\r\n"; I get a default email address If I add this code - $headers = "From:example@example.com\r\n"; it works fine. // multiple recipients $to = $email; $from2 = $_SESSION['no_reply']; //echo "This is the from2" . $from2; //exit; // subject $subject2 = 'You have a new message from ' . $_SESSION['site_name'] .''; //begin of HTML message $message2 = 'You have a new message.<br>'; $message2 .= 'From: '. $username1; $message2 .= '<br>Message Details'; $message2 .= '<br><a href="'.$site_url .'">Log in to see the message</a>'; $message2 .= '<br><br><br>'; //end of message $headers = "From:'.$from2.'\r\n"; $headers .= "Content-type: text/html\r\n"; // Mail it mail($to, $subject2, $message2, $headers); I did echo out the $form2 to make sure it had a value and it does.. Please advise.. Thanks, Dan
  11. Nevermind! Thanks guys for your help!
  12. What code could I add to tell that what is in the array?
  13. Hello Guys, I have the following code foreach($ct->data as $key => $value){ if(!in_array($ct->data[$key][3],$arr_read_messages)){ $ct->data[$key][3]='<a class="ezjax" href="view_message.php?id='.$ct->data[$key][0].'" class=”unread”>'.$ct->data[$key][3].'</a>'; }else{ $ct->data[$key][3]='<a class="ezjax" href="view_message.php?id='.$ct->data[$key][0].'">'.$ct->data[$key][3].'</a>'; } and when I run the code I get the error message Warning: in_array() [function.in-array]: Wrong datatype for second argument in Any idea what the error message means?
  14. Thanks for the reply.. I changed your code a little cause it was causing syntax errors and it still doesn't work. Here is the code that you gave me that has been modified. 1. Added the following code foreach($ct->data as $key => $value){ $ct->data[$key][3]='<a href=#" onclick="part2('.$ct->data[$key][0].');" href="javascript:void();">'.$ct->data[$key][3].'</a>'; 2. Added this is the header <script type="text/javascript"> function part2(id) { var part2 = document.getElementById('part2'); if ( part2.className == 'hidden' ) { part2.className = 'visible'; document.getElementById('message').InnerHTML = 'This is the ID: '+id } else { part2.className = 'hidden'; } } </script> 3. Added this in the hidden div <span id=message></span> Still not displaying the id.. Please advise..
  15. Hello Guys, I need some help here.. I have a page that has a grid on it and I have a hidden div(below the grid). When the link is clicked inside the grid it opens the hidden div (With me so far?) using the following code for the link in the grid. foreach($ct->data as $key => $value){ $ct->data[$key][3]='<a href=#" onclick="part2();" href="index.php?messages&id='.$ct->data[$key][0].'">'.$ct->data[$key][3].'</a>'; Here is the JS to show the hidden div <script type="text/javascript"> function part2() { var part2 = document.getElementById('part2'); if ( part2.className == 'hidden' ) { part2.className = 'visible'; } else { part2.className = 'hidden'; } } </script> The problem I have is its passing the id to the hidden div, but its also refreshing the page (Which is not cool when you have a hidden layer that opens. Here is the code for the hidden layer <div id="part1"> <p>Messages</p> </div> <div id="part2" class="hidden"> <p><a href=index.php?content=messages>close</a></p>'; $id = $_GET['id']; echo " This is the id - $id </div> If I do it this way it wont reload the pages but it also wont pass the var foreach($ct->data as $key => $value){ $ct->data[$key][3]='<a href=#" onclick="part2();" href="#&id='.$ct->data[$key][0].'">'.$ct->data[$key][3].'</a>'; So looks like I need to pass the var through the onclick function or some js function but not sure how.. Any help would be appreciated.. Thanks! Dan
  16. I will give it a try Paul and let you know.. Thanks for the help
  17. O.99 would not be a valid number.. 10,000 - 800,000 would be valid numbers..
  18. Same thing happens, it strips out the period also
  19. Hi Paul, I want to remove the comma.. Not add one
  20. Ok what would you use instead of is_numberic? What if I wanted to just strip the comma? When I added this code function check_Price($price,$member_id,$description,$ip){ $price = str_replace(',', '', $price); if (isset($price) && (!is_numeric($price))) { Echo "No"; } } If I enter in something like 24,555 I get just 24 in the database..It removes the comma but everything after words.
×
×
  • 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.