Jump to content

johny20

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About johny20

  • Rank
    Newbie

Profile Information

  • Location
    Alps
  1. OK, so the main page looks like this (I put the scripts two times) : <!DOCTYPE html><html class="no-js"><title>Animals</title> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"><script><script src="scripts/jquery-1.9.1.min.js"></script><script>$(function(){//$('h4').live('click', function(){ // jQuery 1.3+//$(document).delegate( 'h4','click', function(){ // jQuery 1.4.3+$(document).on( 'click','h4', function(){ // jQuery 1.7+ alert($(this).html())});});</script><script src="scripts/modernizr-2.0.6.min.js"></script><script src="scripts/jquery.rondell.js"></script> <script src="fromforum.js"></script><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"></div> <script src="scripts/jquery-1.9.1.min.js"></script> <script src="scripts/jquery.rondell.js"></script> <script src="fromforum.js"></script></body></html> But again nothing works. I also removed the scripts from the bottom and I placed them again but nothing new... The second page is as you mentioned above!
  2. OK, now I got what you mean! the main page will have all of the CSS and JSs and the second page will have only the above code.
  3. Hi again. Thanks so much that help me. OK, look what I did (main/first) page: <html><head><title>Animals</title><script src="scripts/jquery-1.9.1.min.js"></script><script src="scripts/modernizr-2.0.6.min.js"></script><script>$(function(){//$('h4').live('click', function(){ // jQuery 1.3+//$(document).delegate( 'h4','click', function(){ // jQuery 1.4.3+$(document).on( 'click','h4', function(){ // jQuery 1.7+ alert($(this).html())});});</script> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"></div> <script src="scripts/jquery-1.9.1.min.js"></script> <script src="scripts/jquery.rondell.js"></script> <script src="fromforum.js"></script></body></html> So, the second page is like this: <!DOCTYPE html><html class="no-js"> <head><!-- <link rel="stylesheet" href="../examples/screen.css" type="text/css" media="all" title="Screen"> --> <!-- <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"> --><!-- <script src="scripts/modernizr-2.0.6.min.js"></script> --> <title></title> </head> <body> <br> <!-- <div id="rondellCarousel" class="hidden"> --> <a target="_blank" rel="rondell_1" href="images/band.jpg" title="My favourite band"> <img src="images/band_small.jpg" alt="Band" title="My favourite band"> <h5>Awesome concert</h5> <p>My favourite band.</p></a><a target="_blank" rel="rondell_1" href="images/dog.jpg" title="My dog"><img src="images/dog_small.jpg" alt="Dog" title="My dog"> <h5>My dog</h5> <p>Standing in front of a glass door and wants in.</p></a><a target="_blank" rel="rondell_1" href="images/cat.jpg" title="My cat"><img src="images/cat_small.jpg" alt="Cat" title="My cat"> <h5>My cat</h5> <p>Sleeping...</p></a><a target="_blank" rel="rondell_1" href="images/boar.jpg" title="Boar"><img src="images/boar_small.jpg" alt="Boar" title="Boar"> <h5>Dead boar on the wall</h5> <p>Hanging around.</p></a><a target="_blank" rel="rondell_1" href="images/snow.jpg" title="Snow"><img src="images/snow_small.jpg" alt="Snow" title="Snow"> <h5>Winter wonderland</h5> <p>The german alps.</p></a><a target="_blank" rel="rondell_1" href="images/rabbit.jpg" title="Rabbit"><img src="images/rabbit_small.jpg" alt="Rabbit" title="Rabbit"> <h5>Bunny</h5> <p>In my brothers garden.</p></a><a target="_blank" rel="rondell_1" href="images/trash.jpg" title=""><img src="images/trash_small.jpg" alt="Trash" title="Trash"> <h5>Trash</h5> <p>Somewhere in the USA.</p></a><h4>Click me to show alert</h4><!-- </div> --><!-- <script src="scripts/jquery-1.9.1.min.js"></script> --><!-- <script src="scripts/jquery.rondell.js"></script> --> </body></html> and the external JS (fromforum.js) file is like this: (function() { $(function() { var carousel; carousel = $("#rondellCarousel > *").rondell({ preset: "carousel" }); //$(".resize-button").on(function(e) {$(document).on( 'click','.resize-button', function(e){ e.preventDefault(); return carousel.fitToContainer(); }); return $.ajax({ //url: "http://www.wookmark.com/api/json", dataType: "jsonp", success: function(data, text, xhqr) { var item, rondellContent, _i, _len, _ref; if (text === "success") { rondellContent = ""; _ref = data.slice(0, 25); for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; rondellContent += " <a href="" + item.image + "" title="" + item.title + " @ " + item.url + "" target="_blank" style="display:none"> <img src="" + item.preview + "" title="" + item.title + "" width="" + item.width + "" height="" + item.height + ""/> </a> "; } return $("#rondellCubic").html(rondellContent).children().rondell({ preset: "cubic" }); } } }); });}).call(this); When I click on the <h4>, I get the alert. But nothing works again. Is the order of the scripts wrong? When I run it on IE I get an error -> Syntax error filename.html line:1 char:1 code:0 and when I click the 'Animals' link I do not get any other error.
  4. Hi, thanks for the reply. I linked the jQuery inside my main file : <script src="scripts/jquery-1.9.1.min.js"></script> then I changed the click() to live(), but I thought that this has to do with the prev/next buttons at the image viewer. Nothing worked again... Yes, I want to retrieve that specific <div> and I can't understand why since it works on the second page, it can't work on the main one..
  5. Hi, I have two pages. The first page has two links, when a user clicks on one of them then s/he can view some information. I have used an image viewer taken from http://projects.sebastianhelzle.net/jquery.rondell/examples/carousel.html and I have set it according to my needs. the code of the first/main page is: <html><head><title>Animals</title><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById("rondellCarousel").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","second.html",false);xmlhttp.send();}</script></head><body> <a href = "#" onClick = "loadXMLDoc();">Αnimals</a><br /> <br /><a href = '#' >Cars</a><div id = "rondellCarousel" class = "false"><!-- I expect to see the image viewer here :/ --></div></body></html> The code of the second page is: <!DOCTYPE html><html class="no-js"> <head> <link rel="stylesheet" href="scripts/jquery.rondell.css" type="text/css" media="all" title="Screen"> <script src="scripts/modernizr-2.0.6.min.js"></script> <title></title> </head> <body> <br> <div id="rondellCarousel" class="hidden"> <a target="_blank" rel="rondell_1" href="images/band.jpg" title="My favourite band"> <img src="images/band_small.jpg" alt="Band" title="My favourite band"> <h5>Awesome concert</h5> <p>My favourite band.</p></a><a target="_blank" rel="rondell_1" href="images/dog.jpg" title="My dog"><img src="images/dog_small.jpg" alt="Dog" title="My dog"> <h5>My dog</h5> <p>Standing in front of a glass door and wants in.</p></a><a target="_blank" rel="rondell_1" href="images/cat.jpg" title="My cat"><img src="images/cat_small.jpg" alt="Cat" title="My cat"> <h5>My cat</h5> <p>Sleeping...</p></a><a target="_blank" rel="rondell_1" href="images/boar.jpg" title="Boar"><img src="images/boar_small.jpg" alt="Boar" title="Boar"> <h5>Dead boar on the wall</h5> <p>Hanging around.</p></a><a target="_blank" rel="rondell_1" href="images/snow.jpg" title="Snow"><img src="images/snow_small.jpg" alt="Snow" title="Snow"> <h5>Winter wonderland</h5> <p>The german alps.</p></a><a target="_blank" rel="rondell_1" href="images/rabbit.jpg" title="Rabbit"><img src="images/rabbit_small.jpg" alt="Rabbit" title="Rabbit"> <h5>Bunny</h5> <p>In my brothers garden.</p></a><a target="_blank" rel="rondell_1" href="images/trash.jpg" title=""><img src="images/trash_small.jpg" alt="Trash" title="Trash"> <h5>Trash</h5> <p>Somewhere in the USA.</p></a></div> <script src="scripts/jquery-1.9.1.min.js"></script> <script src="scripts/jquery.rondell.js"></script> <script type="text/javascript">(function() { $(function() { var carousel; carousel = $("#rondellCarousel > *").rondell({ preset: "carousel" }); $(".resize-button").click(function(e) { e.preventDefault(); return carousel.fitToContainer(); }); return $.ajax({ url: "http://www.wookmark.com/api/json", dataType: "jsonp", success: function(data, text, xhqr) { var item, rondellContent, _i, _len, _ref; if (text === "success") { rondellContent = ""; _ref = data.slice(0, 25); for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; rondellContent += " <a href="" + item.image + "" title="" + item.title + " @ " + item.url + "" target="_blank" style="display:none"> <img src="" + item.preview + "" title="" + item.title + "" width="" + item.width + "" height="" + item.height + ""/> </a> "; } return $("#rondellCubic").html(rondellContent).children().rondell({ preset: "cubic" }); } } }); });}).call(this);</script> </body></html> The problem is that, even if Ajax works without getting any problem, the pictures are not presented like a "carousel image viewer". If I put directly the second page in the address bar and browse it, I see the images as I wish (like a carousel image viewer with next/prev arrows). Can anyone help with that? Thank you in advance.
  6. Hello, I can't get data from mysql when I put Greek characters in SELECT statement. require_once(dirname(__FILE__).'etc etc etc etc');$mysqli->query("utf8_general_ci"); // I have tried "UTF8" - Didn't work$query = "SELECT * FROM graf WHERE onoma LIKE 'ΓΕ%' ";$mysqli->query("SET CHARACTER SET 'utf8_general_ci'");$result = mysqli_query($mysqli,$query);if ($result !=0){ while ($row = mysqli_fetch_assoc($result)) { echo $row['onoma']; } }echo mysqli_error($mysqli); //gives no errorecho mysqli_sqlstate($mysqli); //gives 00000 which means the statement is correct Also, in MySQL the collation is 'utf_general_ci' for each row. If I do a "select * from graf" I get the data without any encoding problem. Any ideas please?
  7. hotmail, gmail etc get the email as I described... Well, I have no clue about how to do that. Maybe, I will send email to my service provider for further assistance. Thank you for the reply.
  8. I use the email() function in order to send emails to the users of my system. The problem is that when they receive the email, they see something like this: myUserName@the_servername.com [myUsername@the_servername.com] on behalf of Web Master [webmaster@mydomain.com]myUsername is the username I use to log-in on Cpanel! How I can avoid all these and keep only the part after the "on behalf"? the code I have so far: $message = "mplampla";$headers = 'Bcc:' .$email. "\r\n";$headers .= 'From: Web Master <webmaster@mydomain>'."\r\n"; //I want only thismail('',"Invitation",$message,"$headers"); The $email is specified by me, using a text field.
  9. johny20

    if, else if, else

    So, what would you like to implement? The $pass1 value to be not empty AND different from $pass2 value AND with more than 20 characters AT THE SAME TIME? Or you need to check them individualy?(sorry for caps but I want to point the difference tha will help in development). if you want them simultaneously then you should do something like this: if (($pass1=="") && ($pass1!=$pass2) && (strlen($pass1) > 20)) echo "ERROR!"; Another way is to use the 'if' and 'elseif': if ($pass1=="") {echo "Empty field";} elseif ($pass1 != $pass2) {$updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your Password fields below do not match.<br /></font>'; } elseif (strlen($pass1) > 20) {$updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your New Password is too long. 6 - 20 characters please.<br /></font>'; } elseif (strlen($pass1) < 6) {$updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your New Password is too short. 6 - 20 characters please.<br /></font>'; } else {$sql = mysql_query("UPDATE project SET password='$pass1' WHERE id='$id'")or die (mysql_error());$updatmsg = '<font color="#006600" size="+1">Your password was updated successfully.</font>';} I didn't test/check the code as I don't have any appropriate IDE and PHP installed on my PC. Just put the code in Netbeans or Eclispe to check for errors. Then, check the error console of your browser and post any error here. Also, you can use javascript for that operation.
  10. johny20

    PHP Email Form

    I don't know if you resolved that, but have a look at what I did in order to send mail using PHP. $message = "blablabla"; // I hardcoded the message, you can allow user to specify it.$headers = 'Bcc:' .$email. "\r\n"; //$email is the email you would like to send the message($message)$headers .= 'From: webmaster@rottingchristforever.com'."\r\n";mail('',"Invitation",$message,"$headers"); And now the problems are starting! Hotmail will place the email that you sent in the Junk folder! I don't know about gmail or yahoo but they probably do the same. Only my university's account (we use outlook.com ) received the mail without any problem. Good luck!
  11. Yes and No. I did it before 2 minutes. It goes to delete.php and since the user hasn't specified any ID then it can't delete any entry. It is not the best behaviour but at least it works for me! The following code might resolves that issue:function test(){ if(document.pressed == 'Edit') { document.testform.action ="../edit.php"; return true; } else if (document.pressed == 'Delete'){document.testform.action = "delete.php";return true;} else { return false;}}
  12. Sorry for the late reply but I didn't receive notifications about your replies..I resolved the problem by using Javascript as mentioned by Obi1 . Also, justsomeguy's post seems to be correct but, in my case, I don't like to use 1000 web pages.Scenario: We have stored some values in Mysql and then we present the values to user. On the same page we have some additional options like 'Delete the entry' or 'Edit the entry'. According to the will of the user we have to POST the data to the delete.php OR to the edit.php to perform the operation. <html><head><script type="text/javascript">function test(){ if(document.pressed == 'Edit') { document.testform.action ="../edit.php"; } else {document.testform.action = "delete.php";} return true; } </script></head><body><!-- appropriate php code to SELECT the data from the mysql server and present them to the user --><form name = 'testform' method='post' onsubmit= 'return test();'><h3>Please input the <u>unique id</u> you would like to edit:</h3><input type="text" size = "4" id = "id" name = "id" /> <input type = "submit" value = "Edit" id = 'Edit' onclick="document.pressed=this.value" /><input type = "submit" value = "Delete" onclick="document.pressed=this.value" /></form></body></html> So, I post the data to the appropriate php page. I haven't tested too much that approach but I don't think it is problematic.Hope that it will help some people!
  13. Hello!I have a form with a textbox. All I want to do is to post the data to a page according to which button was clicked.Suppose that I ask for the user to input an ID. Then there are two buttons: Edit and Delete. The edit button must send the ID to the edit.php and the delete button to the delete.php. <form method = "post" action ="?"><input type = "text" id = "ID" /><input type = "submit" value = "Edit" onClick="window.location=''edit.php"/><input type = "submit" value = "Edit" onClick="window.location=''delete.php"/> Well, I know it doesn't work but I want one form because if I am going to use two forms I will mess the layout (I will add more buttons.)Any idea please?
  14. Redefinition of the problem! I checked my application on Windows XP with Mozilla 5.0 (firefox/2.0.0.2). I didn't experience any problem at all! When I run it on Linux or Windows XP with Mozilla 5.0 firefox canonical for Ubuntu - 1 and Mozilla 5.0.1 respectively, I face the problem. It seems that there is an issue with the last version then... ANW, thank you again!
  15. Thank you guys for your guidance. I 'll be back, in about a month, cause I have to continue the development of other aspects of that chat application.Summary: I 'll try the asynchronous approach, I will move the CSS in an external file and I will do this "true think" (I didn't understand it actually!) with the keyboard input.Also, I forgot to mention that I didn't receive any error in Mozilla's error console.
×
×
  • Create New...