Jump to content

xtopolis

Members
  • Posts

    1,422
  • Joined

Everything posted by xtopolis

  1. Possibly use .match instead of .exec. And then check if isSteam is true or not
  2. I think on the form you would add <form onsubmit="return checkpostal()" name="steamid_form"> and in function checkpostal() you would have document.steamid_form.submit() instead of return true; if anything, I would think that you would need the "return checkpostal()". We would need to see the form code to be sure, and test ourselves.
  3. Example Files You will have to change the database query and connection in progress.php and test.php(if you use it, i just had it insert into my db to test it) to match your own again. This should be a clearer example using your code of how to view progress and apply it. Remember it will show 0% until a certain amount of records have been entered (depending on your total).
  4. Further supporting current suggestions, multiple image types: <?php echo count(glob("{*.jpg,*.JPG,*.png,*.PNG,*.gif,*.GIF}", GLOB_BRACE)); ?> From this thread.
  5. See this thread. It may get you started enough to get where you want. Specifically I have an example that you should be able to take, as well as use his code about how he inserts into the db when he does his task in order to keep track. I intend to post an answer to the other guy when I get home in a few hours.
  6. Use your FTP client to set folder permissions. I use Filezilla, right click a folder, ->file attributes, and set them there. With PHP you can use chmod.
  7. I believe this is a mod_rewrite topic. PHP Freaks Board Here is a cheatsheet
  8. It depends, You can use $_GET vars across all the pages, and if it's for a small amount of choices (ie: less than 5, or choices that don't change) you could hardcode it in. example, $color, will always usually be the simple colors (red,blue,green,yellow..etc,etc.) so you could have a check on your get vars: <?php $colorArray = Array("red","blue","green");//etc if(isset($_GET['color'])) { if(in_array($_GET['color'],$colorArray)) { $color = $_GET['color']; }else{ echo 'Not a valid color.'; } } ?> You could also send the vars using $_POST and a hidden form or something... but you'd still probably want to validate... If you're worried about the integrity of the values, you could use sessions, and store the vars in the session data. Afaik, it's hard for clients to change session data.. and if so you could write a check to make sure the values haven't changed. (make a hash value of the choices from page 1, and if it changes when attempting to check the first hash vs a rehash, then something has changed).
  9. http://us.php.net/manual/en/intro.session.php
  10. You could do what you're doing and save it as whatever you want. config.php <?php $website_title = 'PHP freaks'; $website_meta_key = 'PHP, solution, freaks'; .... $website_email = 'phpfreaks@gmail'; ?> To read this: index.php <?php include ('config.php'); echo '<html>'; echo '<head><title>' . $website_title . '</title>'; //sets page title to PHP Freaks ?> Personally I would prefer to use globals instead of regular vars. config_globals.php <?php DEFINE("W_TITLE","PHP Freaks"); DEFINE("W_META_KW","PHP, solution, freaks"); .... DEFINE("W_EMAIL","phpfreaks@gmail"); ?> index.php <?php include('config_globals.php'); echo '<html>'; echo '<head><title>' . W_TITLE . '</title>'; //sets page title to PHP Freaks //etc.. notice that for global vars you do not use a $ prefix, and you write them like above ?>
  11. Hi, I have a slideshow I made in flash around a year ago that uses the 'fade-in/fade-out' technique to go through around 20 photos I have. Now, back then, I manually did this by adding a new layer and spacing it on the timeline appropriately. My question is: I know there is probably an easier way to apply a fadein/out to all photos, and also have it parse a directory so I can add photos easily. Even an XML sheet would be fine. Can anyone point me to a simple tutorial of how to do this, or give me some good places to start? I understand some basic AS, but I'm primarily a PHP coder. It just has to loop through the photos, no controls necessary.
  12. Clients can't be trusted! Don't tell the server what to do
  13. Show us the code containing the element with the id "QUESTION".... You're giving us not enough to go on.
  14. You will want to look into Regular Expressions for both PHP and Javascript (cannot trust that someone won't turn javascript off in order to circument your filter). Google it.
  15. Add it, let us know how it works. When you run into trouble, show us.
  16. Probably because you're using "javascript:" in a place where you could use an event handler. We need to see more code to help you out.
  17. Set the z-index property of their style. The higher the z-index, the more in front the object is.
  18. Using a reg ex: I used: /([0-9]+)$/ -- to me means: Ends with any amount of numbers 0-9. <script type="text/javascript"> var myA = new Array("id_12345","id_142442","id_124125"); var x = myA.length; for(i=0;i<x;i++) { var str = myA[i].match(/([0-9]+)$/); if(str) { myA[i] = str[0]; } } for(a=0;a<myA.length;a++) { document.write(myA[a] + '<br />'); }//returns just the numbers </script> If the array always holds values of id_##### where the "id_" is guaranteed to be there and then followed by a random amount of letters, you could just use a substr method like posted above.
  19. First, I would say don't use frames unless you have to, or have a good reason (not because you like them), a functionality reason. That way when the page submits it takes the whole browser to the new page. If you use frames still, I recall something about having to set something about setting the target of the frame. Read this here on the w3c site FRAMES <- SCROLL DOWN TO SECTION 16.3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <HTML> <HEAD> <TITLE>A frameset document</TITLE> </HEAD> <FRAMESET rows="50%,50%"> <FRAME name="fixed" src="init_fixed.html"> <FRAME name="dynamic" src="init_dynamic.html"> </FRAMESET> </HTML> Then, in init_dynamic.html, we link to the frame named "dynamic". <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>A document with anchors with specific targets</TITLE> </HEAD> <BODY> ...beginning of the document... <P>Now you may advance to <A href="slide2.html" target="dynamic">slide 2.</A> ...more document... <P>You're doing great. Now on to <A href="slide3.html" target="dynamic">slide 3.</A> </BODY> </HTML>
  20. you could have php write out the current time according to the server and store it in a hidden [display: none;] and DISABLED <input> where the value of this input is the servers time. From there have javascript pickup that value to do its "has enough time passed?" calculations. <?php echo '<input style="display: none;" value="' . date("H:i:s") . '" DISABLED />'; ?>
  21. The code attached to this post box is width: 100%; overflow: auto; Look at the forum CSS and you should be able to find your answer.
  22. There is no exact 'realtime' method using code. You can have it request data from the server every x seconds, but it would never be true real time, also it would put a strain on the server if you have many people doing this. For real time options, you might try flash since I think it creates a socket connection for its chat based apps.
  23. You can try a header instead. <?php header("Location: index.php"); ?> I don't know why the meta refresh doesn't work. Remember if you're going to use the header method, you can't output anything to the page before using it.
  24. I have looked through your code and reorganized it and took out some parts that you were not using yet. The main issue was that you were treating $_POST['field2'] as an associative array instead of a regular array. You can't key => value on arrays using numerical indexes as far as I know. I also tab formatted your code for readability. This structure I give you is a little easier to understand I hope. Put your email in the $to field, and replace your multipleselections.php with mine and test it Keep your old copy in case you don't like mine! multipleselections.php <?php //Setup Email $to = 'some@email.com'; //## CHANGE TO YOUR INBOX ## $subject = "inschrijving ";// message subject $message = '';//initialize as blank $products = '';//initialize as blank $headers = "From: " . $_POST['field3'] . "\r\n" . "Return-Path: " . $_POST['field3'] . "\r\n"; //setup email //FUNCTION function new_line_check($a) { if(preg_match('`[\r\n]`',$a)){header("location: $_SERVER[HTTP_REFERER]");exit;} }//nlc //Make sure page is being accessed correctly if ($_SERVER['REQUEST_METHOD'] != "POST") { exit(); } //validate $_POST vars new_line_check($_POST['field1']); new_line_check($_POST['field3']); //FIELD2 RETURNS A REGULAR ARRAY,NOT ASSOCIATIVE if(is_array($_POST['field2'])) { $x = count($_POST['field2']); for($i=0;$i<$x;$i++) { $products .= "Item $i: " . $_POST['field2'][$i] . "\r\n"; } } //check all post vars have values foreach($_POST as $key => $value) { if(!(empty($value))) { $set=1; } } //if value is empty, return to previous page if($set!==1) { header("Location: $_SERVER[HTTP_REFERER]"); exit(); } //FORMAT MESSAGE AS YOU WANT $message = "New order from: " . stripslashes($_POST['field3']) . "\r\n\r\n"; $message .= "Customer Name: " . $_POST['field1'] . "\r\n"; $message .= "Date: " . date("F j, Y - G:i") . "\r\n\r\n"; $message .= $products; $message = stripslashes($message); //SEND THE EMAIL mail($to, $subject, $message, $headers); //OUTPUT MESSAGE TO CLIENT BELOW ?> <!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"> <head><title>test</title></head> <body> <div align="left"><span class="style1">Thanx for your order <?php echo stripslashes($_POST['field3']); ?>! <p>Order:<br /> <?php echo nl2br($products); ?></p> We are managing your order right now.</span> </div> </body> </html>[/b][/b]
×
×
  • 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.