Jump to content

xtopolis

Members
  • Posts

    1,422
  • Joined

Everything posted by xtopolis

  1. Yes, you could make a "main.css" file that had everything ready to go, with divs that had no backgrounds so that they didn't show anything... then in your switch($case) statement / if - else statement include a day.css which could contain only <link rel="stylesheet" type="text/css" href="main.css" /> if($timeOfDay == 'day') { include('day.css'); }else{ include('night.css'); } /* day.css */ div#main_bg { background-image: url('imgs/day.gif'); } /* night.css */ div#main_bg { background-image: url('imgs/night.gif'); } And do that with them. That way it would overwrite whatever value you had to begin with. Please remember that this solution is only viable if you don't have a whole lot of options to worry about, I'd say less than 10-15 in total. If it were to get any more complicated, you should find another approach in order to save yourself a headache.
  2. Possibly a typo, but to start, you're missing a "{" after else it seems. Also, try breaking it down so that you don't have so much after }else{ right away... then gradually add a bit until it breaks.
  3. $selectiontime is an array that holds the results of the resource $querytime has from mysql. You need to echo the same $variable that is in the "mysql_query($variable)" area in order to debug to see that what you're asking mysql for. Also, it would help us to have more code, specifically what sql you're sending.
  4. I don't think this is necessarily a Javascript question, but in general when I hear the term "Global Header" file it means a file that is include on ALL pages. Such as if you had a website where you wanted the top section to look the same on all pages[ it might contain a navigation menu or logo or both ]. Rather than write the same code for x # of pages... you could write the code once and save it as "header.php" or w/e. Then in any pages that you wanted that you would include that page in your current script. That way any changes made to header.php would automatically be reflected in all pages that used the include of that header. tl;dr It basically saves you from having to change all pages where you would want the same information to display by writing it out once, and having any page wanting it copy it to their page.
  5. Possibly looking for position: fixed; http://www.w3schools.com/Css/pr_class_position.asp
  6. I can save just fine.. Maybe show us what you cannot save from that site? http://www.sagessehs.edu.lb/insidep.css shows a section of CSS..
  7. I think I found the problem, or at least where to look. Shows on line 193ish for me. You can search your code for <input name="input" type="checkbox" value=""> <-- This is what is showing up empty It seems your checkboxes are screwy. When I select "No" for ?Receive email updates?, it selects both yes and no. You should either have one check box for "Yes", where unchecked == no. Or use a RADIO button instead to avoid confusion. Fix this section~ <tr> <td class="Form_Headings">Would you like to recieve future email updates?</td> <td><label><span id="spryEmailUpdates"> <input type="checkbox" name="Email Updates Yes" id="EmailUpdatesYes"> <span class="Typestyle_body">Yes</span><span class="Typestyle_body"> <input name="input" type="checkbox" value=""> No</span> <span class="checkboxRequiredMsg">Please make a selection.</span></span></label></td> </tr>
  8. Sorry, let me apologize. I misread, I thought you were having a problem with the mail function, not getting a $_POST value populated. You should haven't to change anything yet from what I've said, apologies. If it's telling you that the "email" section of the form is missing you could do a few debug things. One would be a print_r($_POST) to show all the post values entered. Verify that you're receiving a $_POST['Email'] field with some value.
  9. Is it because your $discount == "TQ" is never true? If you supply a code TQ###, discount will never == TQ only Or are you just saying 'for example'? If the codes are TQ + ##....shouldn't you take a substr($_GET['value'],0,2) to see if the code starts with TQ... http://xtopolis.com/z_phpfreaks/session/?value=TQ123
  10. <?php mail($emailadd, $subject, $text, 'From: '.$_POST["Email"].''); ?> It seems like your last argument in the mail function may not be liked. mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) Taken from http://us3.php.net/manual/en/function.mail.php <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> So try setting a $header var, and making it: $headers = 'From: ' . $_POST['Email']; and then send your mail function like the php.net example: mail($emailadd, $subject, $text, $headers); Seems worth a try to start.
  11. You may make your mysql database columns just have a default value. You can edit this in PHPMYADMIN easily.
  12. <?php $create_folder = 'someusername'; //this is the name of the folder you want to create $dir = '../'; //define your USERS directory, relative to the script that is running's location if(!$dh = opendir($dir)) { echo('Failed to open directory: ' . $dir . ); }//open dir //read folders/(i think this would pick up files as well)that already exist from the directory //place into an array to search $fileList = array(); while (false !== ($file = readdir($dh))) { if ($file != "." && $file != "..") { $fileList[] = $file; } }//while closedir($dh); //check that there are no matching folder names if(in_array($create_folder,$fileList)) { echo('Directory ' . $create_folder . ' already exists.'); }else{ // REMEMBER TO have MKDIR's path relative to the scripts location or else it will make it in the same folder as the running script! if(!mkdir("../$create_folder", 0700)) { echo('Failed to create directory.'); } ?>
  13. Be more specific? - Are you using flash to upload files and having PHP as your backend? - Or uploading flash (.flv) using a form and PHP?
  14. Also, The server to enforce the HTTPS and well as non WWW accessible directories (such as to store a file with the password in it).
  15. After a little searching, I found this page: http://www.weberdev.com/get_example-167.html Seems to do what you want to do, just have to work around their code. However, I don't know why you'd want to load files from a database rather than the files themselves from their directory.
  16. [This is not the best solution, but it is A SOLUTION] If the "image sets" are standard per condition, you could break it down and do this: Firstly, I'm assuming you will not have very many weather conditions... -Day/Night background +Cold/Average/Hot temperature +Cloudly/Sunny/Rainy +Tornado/Hurricane/etc.... So you could do a series of CSS includes... <?php if($timeOfDay == 'day') { echo '<link rel="stylesheet" type="text/css" href="day.css" />'; }else{ echo '<link rel="stylesheet" type="text/css" href="night.css" />'; }//assume night if not day //Then for more options of variation use a switch() statement switch($temperature) case 'cold': echo '<link rel="stylesheet" type="text/css" href="cold.css" />'; break; case 'average': echo '<link rel="stylesheet" type="text/css" href="average.css" />'; break; case 'hot': echo '<link rel="stylesheet" type="text/css" href="hot.css" />'; break; ?> etc etc, and just have each of the "group of options" have their images be in the same place, where really it's only replacing a background image.
  17. Similarly you could use <?php echo '<meta http-equiv="refresh" content="0;url=http://www.someurl.com/" />'; exit(); ?> Look it up, 0 is the time it waits before performing the redirect.
  18. 2 things: MYSQL: First search for something unique that is in each record. This could possibly be Staff ID, depending on what type of records you're entering... Have the mysql first search for a record with a matching unique id (use a COUNT(*) or mysql_num_rows() or w/e), if none are found then allow the record to be inserted, otherwise you can error, or 'pretend to insert it'. PHP: If you have blank records being inserted, use your isset($_POST['elementid']) to check for null/empty values. If they are found, display the form again. If they are set, perform whatever validation, then proceed to the mysql section where it checks for a duplicate value, and if none are found, it adds the record.
  19. Do you have the AJAX XMLHttpRequest object being sent with the "true" flag for asynchronous sending/receiving? xHRO.open("GET", url, true); Are you using a different XMLHttpRequest object for each container?
  20. If you are saying you have to code to check the progress at any time, and it won't interfere with your large file that is being uploaded/inserted to the database, what's the issue? If you set this bit of code in it's own file or whatever, you could just add the line print $percent_complete; Using this concept of yours, I made a 'not so simple' CSS graph using styling from http://applestooranges.com/blog/post/css-for-bar-graphs/?id=55. Example is here: http://xtopolis.com/temp/ (wait 3 seconds for it to start) My math isn't accurate, I know this, but it's 1am, and you get the jist of it. Download files: http://xtopolis.com/temp/ajax_graph.rar ^--I broke it down into each piece so you could see it. -Updater.php: outputs the current time in seconds, with a little manipulation for no leading 0s. -Updater.js: Calls the same function every 3 seconds with 2 arguments (target IDs to change) + Creates the XMLHttpRequestObject as xHRO + Calls updater.php + Takes the output and updates the <span> and <strong> tags. It also updates the <strong> tags innerHTML. + The graph div is 120px wide, so I multiply the 'seconds' output by 2 to make it accurate, and easier to see. -index.css: delicious styles -index.html: i wonder.
  21. That code worked for me. I pretty much copy pasted what you had. It took about 5 seconds for the alert to pop up, but I think it was due to my webserver lagging itself since I was having similar delays with other code on my site. http://xtopolis.com/temp/index.html <~ your code working
×
×
  • 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.