Jump to content

Mudsaf

Members
  • Posts

    462
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Mudsaf

  1. If i got like code

    var x= "info1";var y= "info2";$("example").on('click', function() {$("#content").append(x + y);});<div id="content"></div>

    So if that content div would have alerady info1info2 data inside it it would not run the script.

    var x= "info1";var y= "info2";$("example").on('click', function() { if (($"#content").BLABLABLABLBALAB) //if content doesn't have data already run$("#content").append(x);});<div id="content">info1info2</div>

  2. So the problem is fixed now? A couple notes: First, you should indent your code. I can't read it. Something like this:
    foreach($file_allowed_extensions as $i => $file_allowed_extensions_value) {	if ($fileupload == 0 || !isset($fileupload)) {		if ($file_extension == $file_allowed_extensions_value) {			$fileupload = 1;		} else {			$fileupload = 0;		}	}} foreach($thumbnail_allowed_extensions as $i => $thumbnail_allowed_extensions_value) {	if ($thumbnail_extension == $thumbnail_allowed_extensions_value) {		if ($thumbnailupload == 0 || !isset($thumbnailupload)) {			$thumbnailupload = 1;		} else {			$thumbnailupload = 0;		}	}}

    Second, you can use ternary to shorten your code quite a bit. The following code does the same as above:

    foreach($file_allowed_extensions as $i => $file_allowed_extensions_value) {	if ($fileupload == 0 || !isset($fileupload)) {		$fileupload = ($file_extension == $file_allowed_extensions_value) ? 1 : 0;	}} foreach($thumbnail_allowed_extensions as $i => $thumbnail_allowed_extensions_value) {	if ($thumbnail_extension == $thumbnail_allowed_extensions_value) {		$thumbnailupload = ($thumbnailupload == 0 || !isset($thumbnailupload)) ? 1 : 0;	}}

    Yea i agree with identifying the code, but if i would ternary shorten my code i could not understand it as i do now.
  3. This messes whole page with no erros.

    foreach ($file_allowed_extensions as $i => $file_allowed_extensions_value) {if ($fileupload == 0  || !isset($fileupload)) {if ($file_extension == $file_allowed_extensions_value) {$fileupload = 1;} else {$fileupload = 0;}}} foreach ($thumbnail_allowed_extensions as $i => $thumbnail_allowed_extensions_value) {if ($thumbnail_extension == $thumbnail_allowed_extensions_value) {if ($thumbnailupload == 0 || !isset($thumbnailupload)) {$thumbnailupload = 1;} else {$thumbnailupload = 0;}}}

    This doesnt

    foreach ($file_allowed_extensions as $i => $file_allowed_extensions_value) {if ($fileupload == 0  || !isset($fileupload)) {if ($file_extension == $file_allowed_extensions_value) {$fileupload = 1;} else {$fileupload = 0;}}}foreach ($thumbnail_allowed_extensions as $i => $thumbnail_allowed_extensions_value) {if ($thumbnail_extension == $thumbnail_allowed_extensions_value) {//if ($thumbnailupload == 0 || !isset($thumbnailupload)) {$thumbnailupload = 1;} else {$thumbnailupload = 0;}//}}

    Seems like had problems with $thumbnailupload, changed it to $thumbupload and works.

  4. Im wondering how to select .tabs column on button click because anything i tried didin't work for me. I've tried methdows below. Lets imagine my tab would be

    <div id="tabs"><li><a href="#tabs-1">Page1</a></li><li><a href="#tabs-2">Page2</a></li><li><a href="#tabs-3">Page3</a></li><li><a href="#tabs-4">Page4</a></li><div id="tabs-1">Page1 content here <button type="submit" value="Clickme" id="clickme"></div><div id="tabs-2">Page2 content here</div><div id="tabs-3">Page3 content here</div><div id="tabs-4">Page4 content here</div></div>

    And jQuery

    $(function() {$("#tabs").tabs();$("#clickme").on('click', function() {alert("This works");$("#tabs").tabs({selected:3}); //Doesnt work$("#tabs").tabs("select", "#tabs2"); //Doesnt work});});

    So the alert work but tabs select doesn't. Yes i have jQuery & jQuery-ui files linked. Prob tried all methods herehttp://stackoverflow.com/questions/5912762/jquery-ui-tabs-how-to-select-a-tab-based-on-its-id-not-based-on-index jquery-ui tabshttp://jqueryui.com/tabs/

  5. $left .= <div class="quotepost"><div class="textdiv"><q class="quotetext">.$row['quote'].</q></div><p class="quoteauthor">-.$row['author'].</p></div><br/>; 

    on this line i am getting :Parse error: syntax error, unexpected '<' on line 91 not sure what it is because my tags look fine. Any ideas would be helpful? thanks

    Or if you want to do with double quotes
    $left .= "<div class=\"quotepost\"><div class=\"textdiv\"><q class=\"quotetext\">" . $row['quote'] . "</q></div><p class=\"quoteauthor\">-" . $row['author'] . "</p></div><br/>";

  6. <html><body><a href="url">Home</a> -<a href="url/about.php">About Us</a> -<a href="url/contact.php">Contact Us</a> -<a href="url/privacy.php">Privacy</a> <br /><html><body>
    Firstly i recommend you to go learn bit html, there is awesome tutorial by w3schools. If you would learned bit html you would know that you havent closed either your body or html tag. And body tag will be closed before html tag.http://w3schools.com/html/default.asp http://w3schools.com/css/default.asp
    <html><body><a href="url">Home</a> -<a href="url/about.php">About Us</a> -<a href="url/contact.php">Contact Us</a> -<a href="url/privacy.php">Privacy</a> <br /></body></html>

    Secondly you should learn what is FTP client and how to use it. Many websites use this method to upload files.

    Here would be bit basic code for you, but you have to learn css + html to modify it. Name the file to index.php or index.html depending do you want it to be php page or html page.

    <html><head><title>My very first page</title><style>* {margin:0;padding:0;}#everything {margin: 0 auto;width:1000px;margin-top:30px;text-align:center;}#navigation {width:1000px;text-align:center;font-size:24px;font-weight:bold;}footer {font-size:12px;margin-top:35px;}</style></head><body><div id="everything"><div id="content"><div id="logo"><img src="http://newmediaangels.com/wp-content/uploads/2013/01/Your-Logo-Here-Black-2.jpg" width="800px" height="200px"></div><div id="navigation"><a href="index.php">Home</a> -<a href="about.php">About Us</a> -<a href="contact.php">Contact Us</a> -<a href="privacy.php">Privacy</a></div><hr style="margin: 0 auto;width:600px;margin-top:10px;"><p>Welcome to my new websites, hope you enjoying viewing it.</p><footer>© 2013 Yourname</footer></div></div><html><body>

    Also this code doesn't have to be php unless you want add some login script to it or include files for easier editing.

    • Like 1
  7. sorry i don't know how to edit to insert picture in this post and thats why i create a new one.
    You can also add image afterwards by clicking "Image" picture on textarea. But you have to firstly upload the picture somewhere for example tinypic and paste direct link to image tool. Also you can edit your posts by clicking "edit" button bottom of your reply/topic.o7t76h.png Anyways i guess your php/apache server is not configured correctly. If you wish to test your server with PHP, MySQL i recommend Xampp, Wampp (I recommend for testing only).

    Also you can add another thumbnail by clicking "Use Full Editor" OR "More Reply Options". 3088uxi.png

  8. Is it possible to read .csv or .xlsx file trough javascript/jQuery. My workplace wanted the 5000 lines so i guess the slow on older machines doesn't matter. Also they told that it should be done with javascript/jquery functions to get data. +NO PHP Example...Excel file data

    0 | Item101 | Item1 Subcategory02 | Item1 Subcategory001 | Item1 Subcategory subcategory1 | Item210 | Item2 Subcategory

    And all Items in first category would go to first listbox and when clicking the item it would show the subcategories in second box.

  9. I guess this is problem at chrome, because on IE it works perfectly and on Chrome Zoom-out // In it removes the box. No errors displayed either css on html even inspect element removes the white box. I guess there is no point of showing code because i have no clue what part could make it, anyways my css file is here

    http://mudsaf.info/style/mudsaf.css

    Anyways noticed that if i refresh the page while on bottom on the page it disappears and doesn't appear when scroll up, but if i refresh page while im at top of the page the white box appears.

  10. Try this

    <?phpsession_start();include('themesys.php')?> <br><br><div class="bbox">  <center>  <?php  if (isset($_SESSION['user_id'])) { $con = mysql_connect("mystuff","mystuff","mypw") or die("Could not connect to hostserver: " . mysql_error());mysql_select_db("mydb") or die("Could not select database: " . mysql_error()); $id = $_SESSION['user_id'];$sql="INSERT INTO discussions (name, desc, maker) VALUES('{$_POST['namevalue']}', '{$_POST['descvalue']}','$id')";mysql_query($sql) or die("MySQL error: " . error());echo "Discussion started!";   mysql_close($con);} else {header('Location: login.php');}?> </div></body>

  11. Site Name: Mudsaf.infoSite Description: A little website hobby that i like do at my own time. Some flash games shoutbox and some other stuff also.Site Owner/Developer: MeSite Address: http://mudsaf.infoExtra Comments: Feel free to play flash games at here, the website is under developement but most of it works fine. There will be alot of updates and prob some style fixing and some other fixing also. Login/Regsiter works but the profile page/other stuff about profiles'r under construction.

  12. <p>Here is the code</p><p> </p><div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></div><div><html></div><div><title>new project</title></div><div><head></div><div></head></div><div><body onload="loop()"></div><div> </div><div> </div><div><script type="text/javascript"></div><div>function loop(){</div><div>var names = ['john','gail','julie','jason','zoe'];</div><div>var allnames = names.length;</div><div> </div><div>for (var i = 0; i < names.length; i++) {</div><div> </div><div> </div><div> document.write(names+"<br>");</div><div> </div><div>}</div><div> </div><div>}</div><div></script></div><div></body></div><div> </div><div> </div><div> </div><div> </div><div></html></div><div> </div>
    Why there is so many divs? its like total mess. Try adding code to codearea it might help bit. Cleared the code bit
    <p>Here is the code</p><p> </p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><title>new project</title><head></head><body onload="loop()"><script type="text/javascript">function loop(){var names = ['john','gail','julie','jason','zoe'];var allnames = names.length;for (var i = 0; i < names.length; i++) {document.write(names[i]+"<br>");}}</script></body></html>

  13. Hello, im trying to make javascript/jquery code that will read excel file so i can paste it to listbox and make some functions.It should be like this DEMO 7, but with excel data and not php

    http://kotowicz.net/jquery-option-tree/demo/demo.html

    Here is one example also but mine needs more functionality not just writing all data to javascript, because i have 5000 lines in my excel file.

    http://www.mol.fi/paikat/

×
×
  • Create New...