Jump to content

aseaofflames

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything posted by aseaofflames

  1. if(!isset($_POST['delete'])) exit; change to if(!isset($_POST['delete']) || !file_exists($_POST['delete'])) exit; it will then also exit if the file doesn't exist
  2. What is your css code for the div?
  3. put the php code inside of the <div>
  4. you should prevent the code from executing unless a post has been sent if(!isset($_POST['nazwa'])) exit; echo "<a href=\"".$filename."">".$filename."</a>"; Loops
  5. your loop is completely wrong. $filterentries = mysql_fetch_assoc($selectentries); fetches the first row and then the next if it is called again...and so on... change it to while($filterentries = mysql_fetch_assoc($selectentries)) { and remove $arr=array("$title" ); foreach ($arr as $value) { should work (not tested) aseaofflames
  6. have you tried putting the onmouseout in the first span? also: restoreme(this,'images/off1.gif');" the this would refers to the span object, not the img object. the return false; is also misplaced, it should be the last statement in the onmouseover and onmouseout functions. working code: <div class="code"><script type="text/javascript"> function ShowText(id) { document.getElementById(id).style.display = 'block'; } function HideText(id) { document.getElementById(id).style.display = 'none'; } function replaceme(which,img) { document.getElementById(which).src = img; } function restoreme(which,img) { document.getElementById(which).src = img; } </script> <style type="text/css"> <!-- .box { background-color: #504D6F; border: 1px solid #FFF; height: 100px; width: 200px; padding: 5px; } --> </style> <span onmouseover="ShowText('answer1'); replaceme('img','images/on.gif'); return false;" onmouseout="HideText('answer1'); restoreme('img','images/off1.gif'); return false;" > <img src="images/off1.gif" id="img" style="position:relative; left:200px; top:200px; width:200px; height:100px;"></span> <span id="answer1" class="box" style="display:none;">text info</span></div> </body> </html> Demo: http://www.reactionwebdesign.com/demos/singlepage/imagebox.html for your second question, in order to change the position of the box, you must tweak the css ( try adding top, left)
  7. I fixed the login part of it, it now redirects you to "My Account" when you log in.
  8. There is a link back, it's the My Account link in the menu (on the forum). I will try to make it easier to find. To add Media you have to first link your Flickr, YouTube, or MetaCafe account. Then click sync. (you must have media on your Flickr/YouTube/MetaCafe account in order to add it) If you used the flickr account tester, it has no media uploaded to flickr, so there was nothing to add.
  9. But ajax is way cooler $_REQUEST covers all values in $_GET,$_POST, and $_COOKIE, I don't see how your code stores it into one of those variables.
  10. you could use ajax first assign the id 'content' to your <span> (<span id="content" contenteditable="true">) function addcontent() { //path to php script to handle post var path = "PATH_TO_PHP_SCRIPT.php" //get contents of editable text var content = document.getElementById("content").innerHTML; var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var r = ajaxRequest.responseText; document.getElementById("content").innerHTML=""; } } var php = "content="+content; ajaxRequest.open("POST", path, true); ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxRequest.setRequestHeader("Content-length", php.length); ajaxRequest.setRequestHeader("Connection", "close"); ajaxRequest.send(php); } the above code send a post to PATH_TO_PHP_SCRIPT.php (you can change this). And then clears the text box. The contents of your span are in $_POST['content'] on PATH_TO_PHP_SCRIPT.php;
  11. For those of you who do not want to sign up for an account, use: username: tester password: guest2009 If you sign up for an account, The beta activation code (the code to convert you account to Beta Tester status) is phpfreaks.
  12. I am working on a site that allows you to display all of your media in one place (without reuploading). It currently works with media uploaded to Flickr, YouTube, and MetaCafe. I am in need of Beta Testers. Please test for errors, security vulnerabilities, and ease of use. I could also use some suggestions on how to set up the page that displays the media. http://www.mediachief.net
  13. do you want all the keys in key1 and key2? if so use $key1[] in place of $key1 and $key2[] insead of $key2. This will make the keys arrays of the values from the database.
  14. sorry, if you want the code not to execute if no check box is set then put it right after the <?php tags and follow it with exit;
  15. this code solves #1 and #2. For #3 i think we need to get the loop to run an extra time. <?php echo "<table>"; echo "<b><th>Symbol</th> <th>Market Price</th> <th>Change</th> <th>Change %</th> <th>Open</th> <th>High</th> <th>Low</th> <th>Previous Close</th> <th>Volume</th> <th>52 Week Low</th> <th>52 Week High</th></b>"; $fo=fopen("symbols.txt","r"); while ($line = fgets($fo)) { $arr[] = str_replace(array('_','&'),array('',''),trim($line)); if (count($arr) >= 50) { $url= "http://in.finance.yahoo.com/d/quotes.csv?s=".trim(implode("+", $arr))."&f="."sl1c1p2ohgpvjk"; $handle = fopen($url, "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { echo "<tr>"; foreach($data as $d) echo "<td>$d</td>"; echo "</tr>"; } fclose($handle); $arr = NULL; } } echo "</table>"; ?>
  16. try this: <?php function parse_bbcode($input) { preg_match_all('/\[code\](.*?)\[\/code\]/is',$input, $code) foreach($code[0] as $cur) { $input = str_replace($cur[0],htmlspecialchars($cur[0]),$input); } $bb_replace = array( '/\[img\](.*?)\[\/img\]/is', '/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url_blank\=(.*?)\](.*?)\[\/url_blank\]/is', '/\[textarea\](.*?)\[\/textarea\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url_blank\](.*?)\[\/url_blank\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', '/\[quote\](.*?)\[\/quote\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[color\=(.*?)\](.*?)\[\/color\]/is', '/\[size\=(.*?)\](.*?)\[\/size\]/is' ); $bb_replacements = array( '<img src="$1" alt="$1" />', '<span style="font-weight: bold;">$1</span>', '<span style="font-style: italic;">$1</span>', '<span style="text-decoration: underline;">$1</span>', '<a href="$1">$2</a>', '<a href="$1" target="_blank">$2</a>', '<textarea>$1</textarea>', '<a href="$1">$1</a>', '<a href="$1" target="_blank">$1</a>', '<span class="quote">$1 said:<span>$2</span></span>', '<span class="quote">quote:<span>$1</span></span>', '<code>$1</code>', '<span style="color:$1;">$2</span>', '<span style="font-size:$1;">$2</span>' ); return preg_replace($bb_replace,$bb_replacements,$input); } ?>
  17. you forgot the onblur javascript events change: <tr> <td><input name="your_name" type="text" id="your_name" size="30" /></td> </tr> <tr> <td>Company Name</td> </tr> <tr> <td><label> <input name="company_name" type="text" id="company_name" size="30" /> </label></td> </tr> <tr> <td>Phone</td> </tr> <tr> <td><label> <input name="phone" type="text" id="phone" size="30" /> </label></td> </tr> <tr> <td>Email</td> </tr> <tr> <td><label> <input name="email" type="text" id="email" size="30" /> (REQUIRED)</label></td> </tr> <tr> <td>Confirm Email</td> </tr> <tr> <td><label> <input name="emailconfirm" type="text" id="emailconfirm" size="30" /> </label></td> </tr> <tr> <td height="48" valign="bottom">Comments</td> </tr> <tr> <td><label> <textarea name="comments" id="comments" cols="35" rows="6"></textarea> <br /> </label></td> </tr> to <tr> <td><input name="your_name" type="text" id="your_name" size="30" /></td> </tr> <tr> <td>Company Name</td> </tr> <tr> <td><label> <input name="company_name" type="text" id="company_name" size="30" /> </label></td> </tr> <tr> <td>Phone</td> </tr> <tr> <td><label> <input name="phone" type="text" id="phone" onblur="MM_validateForm('phone','','NisNum');return document.MM_returnValue" size="30" /> </label></td> </tr> <tr> <td>Email</td> </tr> <tr> <td><label> <input name="email" type="text" id="email" size="30" onblur="MM_validateForm('email','','RisEmail');return document.MM_returnValue" /> (REQUIRED)</label></td> </tr> <tr> <td>Confirm Email</td> </tr> <tr> <td><label> <input name="emailconfirm" type="text" id="emailconfirm" size="30" onblur="MM_validateForm('emailconfirm','','NisEmail');return document.MM_returnValue" /> </label></td> </tr> <tr> <td height="48" valign="bottom">Comments</td> </tr> <tr> <td><label> <textarea name="comments" id="comments" cols="35" rows="6"></textarea> <br /> </label></td> </tr>
  18. i don't know know if you just typed it wrong on here, but if (strlen(stristr($chatsrt, $needle))>0) { should be if (strlen(stristr($chatstr, $needle))>0) { and for the second method why are there two foreach statements? also in the foreach $chastr should be $chatstr
  19. psuedocode $name = post variable name (i.e. <input name="name">) $email = post variable email $feedback = post variable name $toaddress = 'feedback@example.com'; if shop is in variable feedback then $toaddress = 'retail@example.com' else if delivery is in variable feedback then $toaddress = 'fulfillment@example.com'; else if bill is in variable feedback then $toaddress = 'accounts@example.com'; check if variable emailis valid (some string + @ + some string + . + some string) if email is not valid show error message and quit. set mail subject, body, and from address send mail to $toaddress with subject $subject body $mailcontent and from address $fromaddress display html page saying that content was submitted. by the way 'retail@example'.com; should be 'retail@example.com';
  20. if(!$_POST['message']) or if(!isset($_POST['message']))
  21. what's the code that you use on index.php? this might have something to do with CURLOPT_COOKIEFILE.
  22. gosh, so harsh. I am trying to allow file downloads from a music hosting site (mediamaster.com) they already allow users to stream the same files I want to allow downloads of. I guess it could be considered leaching, but they already offer a java program that allows users to do this. I was just trying to recreate the program in php so it could be used anywhere with internet access.
  23. Is there any way to force a user to download a file from a remote server without transfering it to my server (or using readfile?) thanks in advance
  24. you haven't initilized the ajax variable: var http; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari http = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ http = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ http = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } }
×
×
  • 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.