Jump to content

firestarter30

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

firestarter30's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @kenrbnsn I get the JSON parse error only when the mail function is inside the script any ideas why?
  2. Hmmmm I go this error while using the array : There was an SyntaxError: JSON.parse error due to a parsererror condition. This is the ajax call with the error status massages to help you a little understand my logic function submitForm(formData) { $.ajax({ type: 'POST', url: 'feedback.php', data: formData, dataType: 'json', cache: false, timeout: 5000, success: function(data) { $('form #response').removeClass().addClass((data.error === true) ? 'error' : 'success') .html(data.msg).fadeIn('fast'); if ($('form #response').hasClass('success')) { setTimeout("$('form #response').fadeOut('fast')", 5000); } }, error: function(XMLHttpRequest, textStatus, errorThrown) { $('form #response').removeClass().addClass('error') .html('<p>There was an<strong> ' + errorThrown + '</strong> error due to a<strong> ' + textStatus + '</strong> condition.</p>').fadeIn('fast'); }, complete: function(XMLHttpRequest, status) { $('form')[0].reset(); } });
  3. I have been having some issues with the above functions and while the mail was sent , it was looking kinda weird :-\ Im facing 2 problems: 1st: implode() , or print_r() didnt worked for me , i guess i should be using a foreach statement but i never stadied seriously the arrays. 2nd: Always a JSON parse error, or invalid JSON error comes out when the email() code exitsts... Here is the code below $name = trim(stripslashes(strip_tags($_POST['name']))); $email = trim(stripslashes(strip_tags($_POST['email']))); $url = trim(stripslashes(strip_tags($_POST['url']))); $title = trim(stripslashes(strip_tags($_POST['title']))); $anchortext = trim(stripslashes(strip_tags($_POST['anchortext']))); $description = trim(stripslashes(strip_tags($_POST['description']))); $dropdown = $_POST['dropdown']; $receiver = "example@gmail.com" ; $email_body = array($name,$email,$url,$title,$anchortext,$description,$dropdown); if (!empty($name) & !empty($email) && !empty($url) && !empty($title) && !empty($anchortext) && !empty($description) && !empty($dropdown) ){ // i guess all juice goes here $send = mail($receiver, 'Link Exchange Request', "$email_body", "From: {$email}"); if ($send) { echo 'true'; } } I would like the mail to be presented like Name : blabla Email : blabla@blabla.com Url : blablablabla and so on .. Suggestions?
  4. It worked like a charm nogray , thanks a lot :D :D
  5. Hi all , something short i would like to validate a drop down menu , here is the html code <label for="Website type">Website Type</label> <select name="dropdown"> <option selected="selected">Select A Category</option> <option value="sites">Sites</option> <option value="directories">Directories</option> <option value="blogs">Blogs</option> </select> From the javascript part i tried to validate with this : var dropdown = $('form #dropdown').val(); if(dropdown =='Select A Category'){ valid = '<p>A valid website choice ' + required +'</p>'; } //I tried also with (dropdown =='Select A Category') , (dropdown ='') but didnt worked either. What im missing here? PS: Just for the history , when i was trying to validate the dropdown menu in php , i was assuming that because the "Select A Category" hasnt assinged any value , it would be empty, but after i got suspicious and echo the menu just to see what is happening it echoed Select A Category and when validating like this if ($dropdown == 'Select A Category') { $error_message .= "<p>Please choose your website type.</p>"; } it was working as expected. But is javascript this doesnt work.
  6. Hello , Im trying to make a very simple link trade script , which checks in a page exists and after searches to that page to find a link (in this case my link). But i got stuck in the lalst step of finding my link on a given page. Hope you can help me with that <?php require_once('Connections/my_conn.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $myurl= 'http://mywebsite.com'; //check if the remote site url exists function url_exists($url) { $ch = @curl_init($url); @curl_setopt($ch, CURLOPT_HEADER, TRUE); @curl_setopt($ch, CURLOPT_NOBODY, TRUE); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $status = array(); preg_match('/HTTP\/.* ([0-9]+) .*/', @curl_exec($ch) , $status); } //check if my link exists in the remote site if(($status[1] == 200) && ($myurl== )); { //Insert into database code here } ?> I would like a little help on how to check if my link exist in the trader's url. Thanks in advance
  7. Ok seems that after a lot of reasearch i did it. Something i came up with , was the date format according to RFC2822 standars and here is how to output the date. <pubDate>" . gmdate(DATE_RFC2822,strtotime($row['dateColumn'])) . "</pubDate>
  8. Hello all That forum is my last desperate attemp to do what i want to do. Ok here is the story I want to create a simple rss feed in conjuction with php and mysql. I dont want admin areas ect , i just want when i insert a new listing to my database to be able shown up to my (future) rss subscribers. To be more technically specific i want to show to my surfers updates about 2 tables in my database not all the tables. The example i found so far were about only 1 table, plus i was encounting errors to my script. I would like some ideas, directions if someone is kind enough to help a sad developer :'( Thanks in advance!
  9. The drop down menu is named "link_submission" . Thing is that i can not find a way to say to the drop dowm menu 'send the choosen option for switch()ing' , for the proper insertion to the database to take place. I think now you got my way of thinking.
  10. @akitchin You are right, something like this was spinning to my mind also.. The $site_type , is not coming from the url , this variable is declared by me. Thought that i could "catch" the option from the drop down menu... in order to insert to the proper choosen table (category) , silly me uh? Im prety sure something im missing here...
  11. Hello all Ok here is the problem... I want when a user inputs the requested data to the text fields , the script to insert those data in the prope table depending on the choise the user does by choosing one option from the drop down menu. Below is the php code (apparently not working) $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } $site_type = $_REQUEST['category_selection']; if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "link_submission") && ($site_type = "Web_Sites")) { $insertSQL = sprintf("INSERT INTO partner_sites (url, url_title, anchor_text, `description`, webmaster_name, webmaster_email, category) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['url_field'], "text"), GetSQLValueString($_POST['title_field'], "text"), GetSQLValueString($_POST['anchor_field'], "text"), GetSQLValueString($_POST['description_field'], "text"), GetSQLValueString($_POST['webmaster_nane_field'], "text"), GetSQLValueString($_POST['webmaster_email_field'], "text"), GetSQLValueString($_POST['category_selection'], "text")); mysql_select_db($database_content_conn, $content_conn); $Result1 = mysql_query($insertSQL, $content_conn) or die(mysql_error()); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "link_submission") && ($site_type = "Blogs")) { $insertSQL = sprintf("INSERT INTO partner_blogs (url, url_title, anchor_text, `description`, webmaster_name, webmaster_email, category) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['url_field'], "text"), GetSQLValueString($_POST['title_field'], "text"), GetSQLValueString($_POST['anchor_field'], "text"), GetSQLValueString($_POST['description_field'], "text"), GetSQLValueString($_POST['webmaster_nane_field'], "text"), GetSQLValueString($_POST['webmaster_email_field'], "text"), GetSQLValueString($_POST['category_selection'], "text")); mysql_select_db($database_content_conn, $content_conn); $Result1 = mysql_query($insertSQL, $content_conn) or die(mysql_error()); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "link_submission") && ($site_type = "Directories")) { $insertSQL = sprintf("INSERT INTO partner_directories (url, url_title, anchor_text, `description`, webmaster_name, webmaster_email, category) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['url_field'], "text"), GetSQLValueString($_POST['title_field'], "text"), GetSQLValueString($_POST['anchor_field'], "text"), GetSQLValueString($_POST['description_field'], "text"), GetSQLValueString($_POST['webmaster_nane_field'], "text"), GetSQLValueString($_POST['webmaster_email_field'], "text"), GetSQLValueString($_POST['category_selection'], "text")); mysql_select_db($database_content_conn, $content_conn); $Result1 = mysql_query($insertSQL, $content_conn) or die(mysql_error()); } And the html form <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="link_submission" id="link_submission"> <table width="630" border="0" align="center" cellpadding="5" cellspacing="5"> <tr> <td width="76">URL:*</td> <td width="519"><label for="url_field"></label> <span id="sprytextfield1"> <label for="url_field"></label> <input name="url_field" type="text" id="url_field" size="50" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td> </tr> <tr> <td>Anchor Text:*</td> <td><label for="anchor_field"><span id="sprytextfield2"> <input type="text" name="anchor_field" id="anchor_field" /> <span class="textfieldRequiredMsg">A value is required.</span></span></label></td> </tr> <tr> <td>URL Title:*</td> <td><label for="title_field"><span id="sprytextfield3"> <input type="text" name="title_field" id="title_field" /> <span class="textfieldRequiredMsg">A value is required.</span></span></label></td> </tr> <tr> <td>Description:*</td> <td><span id="sprytextarea1"> <label for="description_field"></label> <textarea name="description_field" id="description_field" cols="45" rows="3"></textarea> <span id="countsprytextarea1"> </span><span class="textareaRequiredMsg">A value is required.</span><span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span></span></td> </tr> <tr> <td>Webmaster Name:*</td> <td><label for="textfield2"><span id="sprytextfield4"> <input type="text" name="webmaster_nane_field" id="webmaster_nane_field" /> <span class="textfieldRequiredMsg">A value is required.</span></span></label></td> </tr> <tr> <td>Webmaster E-mail:*</td> <td><label for="textfield3"><span id="sprytextfield5"> <input name="webmaster_email_field" type="text" id="webmaster_email_field" size="40" /> <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></label></td> </tr> <tr> <td>Category:*</td> <td><span id="spryselect1"> <label for="category_selection"></label> <select name="category_selection" id="category_selection"> <option>Select An Option</option> <option value="Web_Sites">Web Sites</option> <option value="Blogs">Blogs</option> <option value="Directories">Directories</option> </select> <span class="selectRequiredMsg">Please select an item.</span></span></td> </tr> <tr> <td> </td> <td><label for="select"></label> <input type="submit" name="button" id="button" value="Url Submission" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="link_submission" /> </form> Im begging for your help.....
  12. Hello, Never did this in the past , so i need some guidelines I have made already the back end programming for uploading my flash movies, to the server but no idea on how to play them. Im planning to have a few rows of videos , lets say 5x5 with pagination, and the user to click on a movie and redirect to a page for viewing it. That means that with one singe flash object with a repeat region, but i dont know how to code the dynamic part for the movie, so the recorset to pic the proper one based on the user selection. I know how to do this with pictures, but once that i tried with movies i go comfuced and left it. I would like your advices pls. Thanks
×
×
  • 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.