Jump to content

roeyhaim

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by roeyhaim

  1. Hello everyone I try to work with Uploadify and Facebox. When the user upload a image i want the image to be link to the BIG image and this link should open in facebox. If i put a link directly it's work fine The problem start when i try to work with uploadify, then the link act as regular link and not with facebox. This is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>upload</title> <link href="<?php echo $base; ?>/js/uploadify.css" type="text/css" rel="stylesheet" /> <link href="<?php echo $base; ?>/js/facebox.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript" src="<?php echo $base; ?>/js/swfobject.js"></script> <script type="text/javascript" src="<?php echo $base; ?>/js/jquery.uploadify.v2.1.4.min.js"></script> <script type="text/javascript" src="<?php echo $base; ?>/js/facebox.js"></script> <script type="text/javascript"> $(document).ready(function() { $('a[rel=facebox]').facebox({ loadingImage : '<?php echo $base; ?>/js/loading.gif', closeImage : '<?php echo $base; ?>/js/cancel.png' }); $('#file_upload').uploadify({ 'uploader' : '<?php echo $base; ?>/js/uploadify.swf', 'script' : '<?php echo $base; ?>/index.php/home/uploadify', 'cancelImg' : '<?php echo $base; ?>/js/cancel.png', 'folder' : 'uploads', 'fileDesc' : 'Image Files', 'fileExt' : '*.jpg;*.jpeg;*.gif;*.png', 'multi' : true, 'auto' : true, 'onComplete': function(event, ID, fileObj, response, data){ $("#uploaded_preview").append("<a href='<?php echo $base; ?>/uploads/" +response+ "' rel='facebox'><img src='<?php echo $base; ?>/uploads/thumbs/" +response+ "' width=\'150px\' height=\'150px\'></a>"); $("input:hidden.image").val(response); } }); }); </script> <div id="uploaded_preview"> </div> <input id="file_upload" name="file_upload" type="file" /> <input type="hidden" class="image" name="image" id="image" value=""/> <p> <a href="http://images.paraorkut.com/img/pics/images/h/hey_sexy-2377.jpg" rel="facebox">This link work fine</a> </html> any idea how i can make this work?
  2. but when i add this line my whole web site not working. Error: 500 internal server error
  3. Hello, i have a ckeditor on my site and when i try to put text on center its show as i want on the editor but when i save it, it save as: <h1 style=\"text-align: center;\"> Hello</h1> and it's not on the center. any ideas how to fix it?
  4. Hello. when i try to send email from my site to gmail it's send the messege to spam. i have a domain and a mailbox on my server. this is my code, i there any way to change it so it's not go to spam? <?php require_once('./mail/class.phpgmailer.php'); $mail = new PHPGMailer(); $mail->Username = 'username'; $mail->Password = 'password'; $mail->From = 'admin@my-domain.com'; $mail->FromName = 'admin'; $mail->Subject = 'Try Admin'; $mail->AddAddress('any-email@gmail.com'); $mail->Body = 'Hey buddy, heres an email!'; if($mail->Send()) echo "OK <br>"; else echo "Fail <br>"; ?>
  5. nobody know? :confused:
  6. Hello... i'm building a simple cms and i have a question... I use ckeditor to edit pages and i want that the user can build a page structure. the user can build a table any way he wants. and he type "##IMAGE##" after he save the page the structure will be like he wants and all the "##IMAGE##" will be replace with the code: "<img src=<?php images/image_name.jpg>" this is dynamic page that come from SQL query. the user only build a structure and the php will show all the result in this structure. any ideas how to do this? hope you understand...
  7. ok... so is there any way to export without the styles? only plain text in XLS? any simple function?
  8. yes.... all the code is OK except for this line...
  9. Hello. can anyone tell me why this code don't work? eveything work except for the "document.getElementById("name").style.borderColor = 'red';" <script type="text/javascript"> window.onload = function() { document.getElementById("submit").disabled = true; document.getElementById("name").onchange = checkIt; document.getElementById("chip_num").onchange = checkIt; } function checkIt() { if (document.all||document.getElementById) { var Aname; var Achip; Aname = document.getElementById("name").value.length; Achip = document.getElementById("chip_num").value.length; if (Aname<1 && (Achip<14 && Achip>1)) { document.getElementById("submit").disabled = true; document.getElementById("name").style.borderColor = 'red'; } else { document.getElementById("submit").disabled = false; } } } </script> ...... <form action="animals.php?action=insert" method="post" name="add"> <table width="50%"> <tr> <td align="center">name:</td> <td><input type="text" maxlength="25" name="name" id="name"></td> </tr> .........
  10. no... because when i write it as HTML code (not inside PHP ) its OK this is my css for this page: body, html { margin:0; padding:10px; color: #242424; background-color: #EBEBEB; background-image: url('../images/page_g.jpg'); background-repeat: repeat-x; background-attachment: fixed; background-position: top left; font-family: "Times New Roman", arial, sans-serif; z-index: -1; } a{ color: black; text-decoration: none; border-width: none; } textarea, select{ border: 1px solid gray; } input { text-align: center; } input, textarea{ width:75%; border: 1px solid gray; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; /* future proofing */ -khtml-border-radius: 5px; /* for old Konqueror browsers */ } select { width:75%; border: 1px solid gray; }
  11. Hello please help me. i dont understand why but in all the radio that this function create i have break between the radio and the text I attached an image that show you what i got... any idea how to solve this? <table width="80%" dir="rtl"> <?php $i = 0; foreach($files as $pName) { echo "<tr>"; echo "<td>" . $pName . "</td>"; echo "<td>"; echo "<input type='radio' name='pageCode$i' value='$editCode[$pName]' />Edit</td>"; echo "<td><input type='radio' name='pageCode$i' value='$showCode[$pName]' />show</td>"; echo "<td><input type='radio' name='pageCode$i' value='' />none</td>"; echo "</tr>"; $i++; } ?> </table> [attachment deleted by admin]
  12. Hello all is there any way to save a dynamic table to xls file as is? i mean the colors and all the style i use for the table. is there any function that do this? i found PHPExcel.... but i dont have the time or the power to start learn all the functions.... any simple class that do so?
  13. Sorry about the spam but i found the function Can any one tell me how to edit it, that i can insert in format dd/mm/yyyy ??? function dateDiff($start, $end) { $start_ts = strtotime($start); $end_ts = strtotime($end); $diff = $end_ts - $start_ts; return round($diff / 86400); }
  14. Hello all, The exact thing that i need is to calculate how much days there is in between two dates. The only problem is that every thing that i found dont care about leap year Anyone have a function to do that?
  15. Hello can anyone tell me why this function don't return anything ? <?php include_once('./header.php'); ?> <?php $var = Array(); $data = $db->get("omnot", "fullname"); foreach($data as $var){ $var = $data; } $input = strtolower( $_GET['input'] ); // the input is ok $len = strlen($input); $aResults = array(); if ($len) { for ($i=0;$i<2;$i++) { if (strtolower(substr(utf8_decode($var),0,$len)) == $input) $aResults[] = array( "id"=>($i+1) ,"value"=>htmlspecialchars($var[$i])); } } from the database i get the values: "roey" , "rrr" , "try" input == r why the function don't go to the line: $aResults[] = array( "id"=>($i+1) ,"value"=>htmlspecialchars($var[$i])); whats wrong with the IF ?
  16. hello my code is this: <script type="text/javascript" src="jquery-1.2.1.pack.js"></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("rpc.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 2000); document.form1.inputString.disabled=true; } </script> as you can see i try to Disabled the text input after the fill done, but when i try this it Disabled the text input before i get to choose from my list (this code is for auto-suggest in form) this is the link to the script: <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" name="inputString" /> how i can do this?
  17. thank you all for your help its work perfectly
  18. Hello everyone, how i can insert to the db string that include "$_GET['id']", and i need this as is. in the table i need to see the string $_GET['id'] and not the value. any ideas ?
  19. I'm developing in NuSphere PhpED. you know how i can config the debugger to that? or its in the php code?
  20. thanks a lot, i missed this part
  21. did this.... its all OK, i get the strings as i wanted.... but something dont work... i think its the checkbox that missing.
  22. <?php if(!isset($_POST['Submit'])) { ?> <form method=post action=addOmna.php?action=add name=add> <center> <table align="center" border="5" dir="rtl" style="border-style: double;"> <tr><td align="center" nowrap="nowrap"> fullname: <input type="text" name="fullname" value="" /></td></tr> <tr><td align="center" nowrap="nowrap"> phone: <input type="text" name="phone" value="" /></td></tr> <tr><td align="center" nowrap="nowrap"> Address: <input type="text" name="address" value="" /></td></tr> <tr><td align="center" nowrap="nowrap"> E-Mail: <input type="text" name="email" value="" /></td></tr> <tr><td align="center" nowrap="nowrap"> agree to get mails: <input type="checkbox" name="mails" value="1" /></td></tr> <tr><td align="center" nowrap="nowrap"> show image profile: <input type="checkbox" name="status" value="1" checked /></td></tr> <tr><td align="center" nowrap="nowrap"> comments: <br><textarea rows="5" name="comments"></textarea></td></tr> <tr><td align="center" nowrap="nowrap"> <BR> <input type="submit" value="Submit" name="Submit" /> </form></td></tr> </table> </html> <?php } else { $db->insert("users", $_POST); } And this is the insert() function from the $db class: function insert($table, $vars){ foreach($vars as $key => $var){ $values .= "'$var', "; $cols .= "$key, "; } $values = substr_replace($values, "", -12); $cols = substr_replace($cols, "", -10); $sql = "INSERT INTO $table ($cols) VALUES ($values)"; mysql_query($SQL) or die('Error, insert query failed: ' . mysql_error()); echo "<center><font size=5 color=red>"; echo "Process Complete ."; echo "<BR>"; echo "<a href=index.php>Home Page</a>"; echo "</font></center>"; } as you can see i need all the values else i got error message: unless you have another idea to this class...
×
×
  • 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.