Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. well if this isn't in a loop i would just do: <span class="float" style="width: 100px;"><a href="javascript:void(0);" onclick="window.open('/admin/form.php?db=outlet&tbl=brands&auto_increment=<?=$auto_increment?>;&action=edtamp;step=1','none','width=750,height=250,menubar=no,status=no,resizable=no,location=no,toolbar=no,scrollbars=yes,left=50,top=50,titlebar=no')"></a></span>
  2. I wouldn't worry about 100 rows. That's nothing. Just put an index on my_id and you should be good.
  3. your quotes are a mess. <? $brand_edit = "javascript:void(0)\" onclick=\"window.open('/admin/form.php?db=outlet&tbl=brands&auto_increment=$auto_increment;&action=edtamp;step=1','none','width=750,height=250,menubar=no,status=no,resizable=no,location=no,toolbar=no,scrollbars=yes,left=50,top=50,titlebar=no')\""; ?> Try that. If you're going to use short tags you might as well just do this: <span class="float" style="width: 100px;"><a href="<?=$brand_edit?>> Note that I left off the closing href quote because you are adding the onclick event in brand_edit you need to close it in the brand_edit string. I think that should work.
  4. You can't make it POST to multiple locations but you can add a command to send an email into the PHP script that does the DB insert. See http://php.net/manual/en/function.mail.php for info on sending an email with PHP. If you're having probs, post a snippet of the script the form POSTs to.
  5. $query = "SELECT user.Member,user.First,user.Last,user.Phone,user.Email,user.Type FROM user WHERE ((user.MemberNo LIKE '$MemberNo%') and ((user.First LIKE '%$name%') or (user.Last LIKE '%$name%')) and (user.Phone LIKE '$contact%') and (user.Email LIKE '$contact%') and (user.Type LIKE '$Type%')) ORDER BY user_stuff.$sort LIMIT $eu, $limit "; You need to bracket your OR statement together. Right now it is being evaluated as (MemberNo and First) OR (last and phone and email and type)
  6. if strpos finds a match it will return the position of the first character which most of the time is > 0 ie. true if any of the browser agents are at the start of the string the if statement will fail falsely. i beleive in order to do that properly you need to do if ( strpos(strtoupper($agent), 'MSIE') !== 0) { to properly look for boolean false instead of zero/false. Hope this makes sense.
  7. Where is your form? Does it get into that if statement and delete the record?
  8. Comment the header tags, print_r the $row array and look at the source code it spits out in your browser.
  9. That article looks right. Keep in mind that the user agent can be spoofed easily so the content is not exactly secure from non members.
  10. Did you look at the output your echoing? Or print out your row arrays to see if they are correct?
  11. There is no method set on your form tag. <form action="edit.php" method="post">
  12. You should also use move_uploaded_file() as appose to copy()
  13. <?php copy($_FILES['banner']['tmp_name']['file'], './banners/'.$photo_id.$ext); ?> <a href="<?php echo safe_output($photo['web_url']); ?>" target="_blank" class="bannerImg"><img src="banners/<?php echo $photo['id'] . $ext; ?>"/></a> For the second line you'll need to get the image type from getimagesize('image/location'); in order to see what type of ext it is. http://php.net/manual/en/function.getimagesize.php
  14. Yes I know that. Thats why you look at the file type and determine what extension to apply. ie. if($_FILES['banner']['type'] == 'image/jpg') $ext = '.jpg'; elseif($_FILES['banner']['type'] == 'image/gif') ext = '.gif'; //etc //etc wildteen is right. It's better to just store the image name.
  15. Look at $_FILES['banner']['type'] to figure out which type of image it is then apply the appropriate extension.
  16. Depending on your HTML format it may or may not show up when rendered by the browser but it will be in your source code.
  17. It means the variable isn't in that array. Print out your POST array to see what it looks like. print_r($_POST);
  18. Assuming no files are named the same. Try something like this: function phpFiles($baseDir,&$files){ $handle = opendir($baseDir); while (false !== ($file = readdir($handle))){ $file_path = $baseDir . "/$file"; //check for directory if(is_dir($file_path)){ phpFiles($file_path, $files); } else { //check for php file $extension = strtolower(substr(strrchr($filename, '.'), 1)); if($extension == 'php'){ // add to array $files[$file] = $file_path; } } } closedir($handle); } $file_array = array(); phpFiles('baseDir',$file_array); I haven't tested it but it should be a good start.
  19. Couple things: -you call sql_addition with 3 arguments. the function declaration doesn't take in any -missing a semi colon <?php echo htmlspecialchars("Add Hours")." " ?> -need single quotes on your query. double quotes is breaking it. "update `vacation` set `avail_vacation`= `avail_vacation` + `added` where employee = .sqlvalue(@$_POST['employee'])"
  20. Try this: $titel = $_POST["titel[$n]"]; or $titel = $_POST['titel[' . $n . ']']; When you use a string with single quotes, PHP will not evaluate any variables inside it.
  21. ah crap. syntax error. try this. (double equals) <a href="<?php echo (curPageURL() == "www.domain.com") ? curPageURL() . "?wptheme=Sidebar%20disabled" : curPageURL() . "&wptheme=Sidebar%20disabled"; ?>">Click here</a>
  22. whats in your php.ini file? i've never had a php.ini file in any of my web dirs.
×
×
  • 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.