PHP - Moved: Popup Not Rendering
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=352864.0 Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=349353.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=352201.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=317537.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=355561.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=329157.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351532.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=354451.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=333559.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347166.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317921.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317523.0 I have search the forum, but i cant find something thats about my problem.. :S Im trying to make a kind of a community website for my friends and others who want to be there.. (Its danish).. I got alot of stuff going in the codes, and now i want some kind of a popup to tell the user when they got a new msg, i trying alot of stuff but i cant find something that works with my codes.. ... I got 2 iframes in the background running to update user status and stuff, i want one of them to create a popup when a new msg is in for the Session user.. This is one of the update pages i got running.. <script> setTimeout("document.location.reload(true);", 60000); </script> <head> <link rel="stylesheet" type="text/css" href="style_blue.css"> </head> <? require_once('#####.php'); //database access require_once('#####.php'); // php functions session_start(); if (isset($_SESSION['user']) AND ($_SESSION['user'] <> '')) { $result = mysql_query("UPDATE users SET time = '".time()."' WHERE id = '$_SESSION[id]'"); } $result2 = mysql_query("SELECT id FROM msg WHERE to = '$_SESSION[id]' AND new = '1'"); $antal2 = ( mysql_num_rows($result2) ); if (($antal2 > '0')) { ## Here i need a code to create a popup telling the user that there is a new msg.. } ?> I really hope someone can help me... :S Btw.. i dont wanna use alert popup cuz then they will stack if a user goes out for a few hours but stays on website.. i am trying to find a way to render stl files into a jpg from a specific angle. any ideas? i have no clue. Hello,
I have a small bit of code that changes the background color of a table cell depending on the value. It works great if I call the script by itself as you can see from this link. http://www.mesquitew...lake-levels.php
But when I include it in on the page where I want to show it like so below, the background colors do not render color correctly as they as suppose to like from the link about, only the text color.
<?php include("inc/inc-lake-levels.php"); ?> It looks like this. I call it in a the table like so. <td style="color:<?php echo $LRH_departTxt; ?>" bgcolor="<?php echo $LRH_departScale; ?>"> <?php echo $LRH_calcDepart; ?></td>I am not sure if this is a PHP problem or a CSS issue but here is the bit of code that creates the colors based on the values. First part is the background color, second part is the text. $LRH_departScale = ''; if ($LRH_calcDepart <= 0 && $LRH_calcDepart > -2) { $LRH_departScale = 'rgb(82, 71, 59)'; } else if ($LRH_calcDepart <= -2 && $LRH_calcDepart > -4) { $LRH_departScale = 'rgb(192, 185, 67)'; } else if ($LRH_calcDepart <= -4 && $LRH_calcDepart > -6) { $LRH_departScale = 'rgb(192, 102, 67)'; } else if ($LRH_calcDepart <= -6 && $LRH_calcDepart > -8) { $LRH_departScale = 'rgb(185, 64, 76)'; } else if ($LRH_calcDepart <= -8 && $LRH_calcDepart > -10) { $LRH_departScale = 'rgb(170, 59, 145)'; } else if ($LRH_calcDepart <= -10) { $LRH_departScale = 'rgb(115, 58, 167)'; } $LRH_departTxt = ''; if ($LRH_calcDepart <= 0 && $LRH_calcDepart > -2) { $LRH_departTxt = 'rgb(186, 245, 171)'; } else if ($LRH_calcDepart <= -2 && $LRH_calcDepart > -4) { $LRH_departTxt = 'rgb(255, 220, 177)'; } else if ($LRH_calcDepart <= -4 && $LRH_calcDepart > -6) { $LRH_departTxt = 'rgb(255, 219, 177)'; } else if ($LRH_calcDepart <= -6 && $LRH_calcDepart > -8) { $LRH_departTxt = 'rgb(254, 177, 185)'; } else if ($LRH_calcDepart <= -8 && $LRH_calcDepart > -10) { $LRH_departTxt = 'rgb(245, 170, 228)'; } else if ($LRH_calcDepart <= -10) { $LRH_departTxt = 'rgb(208, 169, 243)'; }Other than the background colors not rendering correctly when included all else works fine. Is there something I am not doing correctly that is causing this? I am not even sure where the first place to start looking would be. -Thanks I have an array ($other_images) that contains image file names separated by semi colons. I can successfully echo the individual values using echo $other_images[0], $other_images[1], $other_images[2]... When I put it in a for loop, though, I run into the followng error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in... Here is my code: <?php $other_images = explode(";", $data['ItemAltImage']); for($i=0; $i<count($other_images); $i++) { echo "<p><img src='http:\\www.oppictures.com\SINGLEIMAGES\100\" . $other_images[$i] . "' /></p>"; } ?> This is the result of print_r($other_images): Array ( => UNV21200_3_2.JPG [1] => UNV21200_2_2.JPG [2] => UNV21200_4_1.JPG [3] => UNV21200_8_1.JPG [4] => UNV21200_5_1.JPG [5] => UNV21200_6_1.JPG [6] => UNV21200_7_1.JPG [7] => UNV21200_9_1.JPG ) Do you see where I'm making a mistake? Thanks The font is looking weird and not smooth as compared to Firefox: Chrome screenshot: Firefox: This is my CSS: @font-face { font-family: 'Aldrich'; font-style: normal; font-weight: 400; src: local('Aldrich'), url(../font.woff) format('woff'); } body,input{ font-family: 'Aldrich', sans-serif; font-size:12px; }Any idea? Why is the font not smoothed out on Chrome (for font-weight:bold) properties? Hello all, I'm new to PHP and to these forums and i'm having trouble with a little script I'm working on. I have to point out at the start that the script actually works, other than for the error I'm reporting. What it does, is lets the user upload an image to the server and creates a thumbnail imageof it in another folder. This works as intended. (I.e. the images gets uploaded and the thumbnail is created) The issue i'm having is when the work is completed successfully... If there's an error, I update a variable $msg with an error mesage. (File too large, or invalid filetype) If this is the case, the script will render the html code correctly, display the error, then redirect you using javascript after 4 seconds to the original page. No worries here, everything works so far. However, if there is no errors to report and the script is successfull, I update $msg to say "it worked"(or whatever) but instead of displaying the formatted webpage displaying the message, then redirecting after 4 seconds, all that happens is the html code is displayed instead. (If I cut and paste this code into a new htmlfile, it renders correctly.) Attached below is the php code which does all the work. (But not the main php file which calls it) Can someone please point me in the right direction as to what I'm doing wrong! lol (Again, I'm new here so a big hello from me!!!) Code: [Select] <?php print( "<html>\n"); print( " <head>\n"); print( " <title>Random banner and file upload</title>\n"); print( " <link rel=StyleSheet href=\"styles.css\" type=\"text/css\">\n"); print( " </head>\n"); print( " <body>\n" ); $file_upload = "true"; $filetype = $_FILES[ "file_up" ][ "type" ]; $file_name = $_FILES[ "file_up" ][ "name" ]; $startimage = $_FILES[ "file_up" ][ "tmp_name" ]; $largeimage = "images/uploads/$file_name"; $thumbimage = "images/uploadthumbs/thumb-$file_name"; $msg = " "; $invalidfilesize = "<p class='centeralign'>Your uploaded file size is more than 250KB so please reduce the file size and then upload.<br>Visit the help page to know how to reduce the file size.</p>\n"; $invalidfiletype = "<p class='centeralign'>Your uploaded file must be of PNG, JPG or GIF. Other file types are not allowed.</p>\n"; $successfullupload = "<p class='centeralign'>File uploaded successfully! :)</p>\n"; $failedupload = "<p class='centeralign'>File not uploaded successfully! :(</p>\n"; $notinstalled = "<p class='centeralign'>The requested function is not installed on this web server. :(</p>\n"; //If the image is larger than 1Mb, do not upload. if ( $_FILES[ "file_up" ][ "size" ] > 1048576 ) { $msg = $msg.$invalidfilesize; $file_upload="false"; } //If the image is an invalid file type, do not upload. if ( ! ( $filetype == "image/x-png" || $filetype == "image/pjpeg" || $filetype == "image/jpeg" || $filetype == "image/gif" ) ) { $msg = $msg.$invalidfiletype; $file_upload = "false"; } //Start the thumbnail generation. if( $file_upload == "true" ) { $n_width = 160; // Fix the width of the thumbnail images $n_height = 120; // Fix the height of the thumbnail imaage switch ( $filetype ) { case "image/x-png"; $FromFormat = "ImageCreateFromPNG"; $ToFormat = "ImagePNG"; break; case "image/jpeg"; $FromFormat = "ImageCreateFromJPEG"; $ToFormat = "ImageJPEG"; break; case "image/pjpeg"; $FromFormat = "ImageCreateFromJPEG"; $ToFormat = "ImageJPEG"; break; case "image/gif"; $FromFormat = "ImageCreateFromGIF"; $ToFormat = "ImageGIF"; break; } if ( function_exists( "$FromFormat" ) )// Generate the thumbnail. { $im = $FromFormat( $startimage ); $width = ImageSx( $im ); // Original picture width is stored $height = ImageSy( $im ); // Original picture height is stored $newimage = imagecreatetruecolor( $n_width, $n_height ); imageCopyResized( $newimage, $im, 0, 0, 0, 0, $n_width, $n_height, $width, $height ); Header( "Content-type: $filetype" ); $ToFormat( $newimage, $thumbimage ); } else { $msg = $msg.$notinstalled; }// Unable to generate the thumbnail. (GD library not installed on web server?) //Move the uploaded file to the correct place.. if( move_uploaded_file ( $startimage, $largeimage ) ) { $msg = $msg.$successfullupload; } else { $msg = $msg.$failedupload; }//Unable to move uploaded file. } Print( "$msg" ); print( " <script type=\"text/javascript\"><!--\n" ); print( " setTimeout('Redirect()',4000);\n" ); print( " function Redirect()\n" ); print( " {\n" ); print( " location.href = 'index.php';\n" ); print( " }// -->\n" ); print( " </script>\n" ); print( " </body>\n" ); print( "</html>\n" ); ?> Hi All, I have a form that enables the user to know events that occur in a specific city. Most of the time they get the results in a few seconds, despite the fact that many rows in various tables might be searched for detailed infos about the events in that city. However, this form partly relies on a table against which a MySQL event regularly does some operations. If the user uses the form while the event is being executed, they have to wait up to 30 seconds before getting the results, and sometimes only part of the html page is generated. Is there a way to avoid this lengthy waiting time ? I am wondering whether or not the best would be putting the site on maintenance while the event is being executed, with a "please come back in a few minutes" message. Thanks in advance for your help. i have a div with an iframe in it that when i click on a link it pops up but what i am trying to do is add ?old=$folderName to the link but when i do the popup is blank. so does anyone know something i can try. (i am using facebox to create the popup) Code: [Select] this is the link for the popup <a href='#Rename' rel='facebox'>Rename</a> this is with ?old=$folderName added this displays the blank popup <a href='#Rename?old=$folderName' rel='facebox'>Rename</a> this is the div with iframe Code: [Select] <div id="Rename" style="display:none"><iframe src="form.php?old=<?php echo $old=$_GET['old'] ?>" frameborder="0"> </iframe></div> Hi i am looking for a bit of help on a script i am trying to make. Basically i have a page when onload it opens a popup with a random website pulled from the database Code: [Select] <script language="JavaScript1.1"> <!-- function TheNewWin(url) { var popUp = window.open(url,'popup','height=700,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=200'); if (popUp == null || typeof(popUp)=='undefined') { var a = confirm('Please disable your pop-up blocker and click the "Open" link again.'); if (a){ window.location.href = 'popupwarn.php'; }else{ window.location.href = 'popupwarn.php'; } } else { popUp.focus(); } } //--> </script> <body onload="TheNewWin($website);"> After 10 seconds i have it refresh so the popup changes to a new website Code: [Select] header("refresh: 10; websiteviewcontrol.php?id=$website"); What i want to happen is before it changes the popup to a new website i want it to redirect to some website of my choice for example Facebook. So on the 8th second it would go to Facebook then after the 10 it would just reload and get the random website again. The problem im having is i cant get "Some Website" to open in the popup for a few seconds before the reload. |