Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Also make sure session_start is at the top of the page where the session is registered, as well as any other pages the session is going to travel through.
  2. The reason I ask where you create it if you are using session_register well don't the php.net manual says it's deprecated. Instead use $_SESSION['username'] = $_POST['username']; or whatever else the variable is.
  3. 1. Use <?php instead of <? 2. Show the code where you registered your session 3. Try to avoid interpolation on an array. For example instaed of <?php if(!session_is_registered(myusername)){ echo "<font color="red">Please log in using the form below</font>"; } else { echo "Welcome {$_SESSION['myusername']}"; } ?> do <?php if(!session_is_registered(myusername)){ echo "<font color="red">Please log in using the form below</font>"; } else { echo "Welcome " . $_SESSION['myusername']; } ?>
  4. More information. It is like on acid. At one minute it's reading them both but still not using the script properly. Then the next time it reads one but not the other, or vice versa. There is something going on here, I am not aware of. I have never encountered this type of "erratic" behavior with a script before.
  5. The problem is when I let the code go, it comes up and when it tests if the 2 were uploaded with is_uploaded_file, it always gives the else statement instead. Can anyone see what is going on with this script?
  6. I am having a problem, I have a file upload <p>File 1 Upload Area</p> <label for="image1">Image Version</label> <input name="image1" id="image1" type="file" /><br /> <label for="pdf1">PDF Version</label> <input name="pdf1" id="pdf1" type="file" /><br /> <label for="comments1">Comments:</label> <input name="comments1" id="comments1" type="text" maxlength="220" /> <br /> That is the upload form. Now I have the script. <?php echo "UPLOAD STATUS"; // Just echo the start of information # Prepare all variables // id $id = $_POST['id']; // get id $docroot = $_SERVER['DOCUMENT_ROOT']; // get docroot $target = $docroot . "/clients/proofs/"; // create target url with docroot and path // first set $image1 = $_FILES['image1']; $pdf1 = $_FILES['pdf1']; if (isset($_POST['comments2'])) { $comments1 = $_POST['comments1']; }else { $comments1 = FALSE; } // second set $image2 = $_FILES['image2']; $pdf2 = $_FILES['pdf2']; if (isset($_POST['comments2'])) { $comments2 = $_POST['comments2']; }else { $comments2 = FALSE; } // third set $image3 = $_FILES['image3']; $pdf3 = $_FILES['pdf3']; if (isset($_POST['comments3'])) { $comments3 = $_POST['comments3']; }else { $comments3 = FALSE; } // fourth set $image4 = $_FILES['image4']; $pdf4 = $_FILES['pdf4']; if (isset($_POST['comments4'])) { $comments4 = $_POST['comments4']; }else { $comments4 = FALSE; } // fifth set $image5 = $_FILES['image5']; $pdf5 = $_FILES['pdf5']; if (isset($_POST['comments5'])) { $comments5 = $_POST['comments5']; }else { $comments5 = FALSE; } // sixth set $image6 = $_FILES['image6']; $pdf6 = $_FILES['pdf6']; if (isset($_POST['comments6'])) { $comments6 = $_POST['comments6']; }else { $comments6 = FALSE; } // seventh set $image7 = $_FILES['image7']; $pdf7 = $_FILES['pdf7']; if (isset($_POST['comments7'])) { $comments7 = $_POST['comments7']; }else { $comments7 = FALSE; } // eight set $image8 = $_FILES['image8']; $pdf8 = $_FILES['pdf8']; if (isset($_POST['comments8'])) { $comments8 = $_POST['comments8']; }else { $comments8 = FALSE; } // ninth set $image9 = $_FILES['image9']; $pdf9 = $_FILES['pdf9']; if (isset($_POST['comments9'])) { $comments9 = $_POST['comments9']; }else { $comments9 = FALSE; } // tenth set $image10 = $_FILES['image10']; $pdf10 = $_FILES['pdf10']; if (isset($_POST['comments10'])) { $comments10 = $_POST['comments10']; }else { $comments10 = FALSE; } // Below we need to go through each file. It's going to be the same process with each file // So I am going to make an attempt at doing this with an array, to make it faster. // As well as make it carry better performance. // set 1 echo "<hr />"; echo "<strong>Set 1 Status</strong>"; echo "<br />"; if (!empty($image1['name']) && !empty($pdf1['name'])) { // check if both images where uploaded // get all names prepared for uploading // get image names $image1tmp = $image1['tmp_name']; $image1name = $id . "_" . $image1['name']; $image1target = $target . $image1name; // get pdf names $pdf1tmp = $pdf1['tmp_name']; $pdf1name = $id . "_" . $pdf1['name']; $pdf1target = $target . $pdf1name; echo "image temp"; echo "<br />"; echo $image1tmp; echo "<br />"; echo "pdf name"; echo "<br />"; echo $pdf1tmp; echo "<br />"; exit; if (is_uploaded_file($image1tmp) && is_uploaded_file($pdf1tmp)) { if (move_uploaded_file($image1tmp, $image1target) && move_uploaded_file($pdf1tmp, $pdf1target)) { echo "Files were uploaded successfully.<br />"; $insert = "INSERT INTO proofs(userid, imagename, pdfname, comments) VALUES('$id', '$image1name', '$pdf1name', '$comments1')"; if (mysql_query($insert)) { echo "It was also uploaded into the database successfully.<br />"; }else { echo "Problem's inserting it into database though.<br />"; } }else { echo "There was a problem uploading one of these files.<br />"; } }else { echo "The files did not make it to temporary upload.<br />"; } }else { echo "<span style=\"color:red\">You did not upload a file for this set, or you only uploaded one.<br /> Both are required. You must have both a pdf version as well as<br/ > an image version for it to work properly.</span><br />"; } // set 2 echo "<hr />"; echo "<strong>Set 2 Status</strong>"; ?> You see the debugging code in there, it is not noticing the image tmp name. The tmp name of the pdf file is being recorded, however for the first file it is not noticing. I double/triple checked my variables, it appears as if it's unsetting my variable out of nowhere? Any advice? EDIT I know for a fact it is making it to atleast <?php if (!empty($image1['name']) && !empty($pdf1['name'])) { ?> That line of code. This is the problem, it is making it past that (or the debugging code would not even run. This is a rather strange problem I have never encountered before.
  7. Right, the original css file is the original styling. It is always active. However when in print mode the print one takes over. It does not erase the first, but the idea is behidn the "cascading". It basically overwrites (it takes priority) over any styles in the first one when in print mode. So you need to always have the print one BELOW any others. That way it can overwrite anything in the other files, and it makes sure it takes priority.
  8. Hi, I was just concerned and wondering if you solved your problem yesterday or not. Let us know here if you didn't I can try and help more, maybe someone else will have ideas. WHere do you stand with your current problem right now, I don't want you just stuck here without an answer, you have helped me many times, I like the opprotunity to return the favor. So did you fix it, or are you still having problems with it?
  9. No, the print he showed me just makes the print screen come up. It activates the printer on there browser to start up the printer, it does nothing to style the page for printing. If you want a page that prints right, you need to create a CSS file. Attach it to the document using the media type "print" it makes it become ignored UNLESS the browser is in print view, and is printing the document. The point of this is to remove things you don't want part of the printing (hiding certain things). Or making it look good for black/white only printers by removing clashing colors. As well as removing unnecessary components that will jsut clutter the printer (navigation, header, footer, whatever else might be obtrusive to simply printing the data).
  10. I am having a problem with FCKEditor. It's working in firefox, but for some reason in IE6 it's not even coming up at all. It's basically obsolete, the menu comes up but the editable area does not, and hte spellchecker is not working.
  11. I know in another post in regards to html entities, there was a custom function http://www.phpfreaks.com/forums/index.php/topic,128079.0.html You will find someone that made entity safe functions, maybe that will help. Try that out, if not explain that is happening exactly. Is it encoding when you are not wanting it to, or vice-versa. (Sorry if it's spelt wrong).
  12. Basically like this <?php // queries to retrieve the numbers, let's assume $row is holding the fetch array // have your phone formatting here. I don't know what it takes to send a sms (phone message), through // php, so I can't help on that part while ($row = mysql_fetch_array($query)) { // mail for each phone number here. } ?>
  13. http://www.xml.com/pub/a/98/08/xmlqna0.html
  14. You could run the actual Microsoft file through html entities when it is uploaded (save a new copy of it). Then when it comes time to show it, create the file again and decode it. The last time I had problems with microsoft word, I just used http://www.byte.com/documents/s=9502/byt1125943459937/0905_pournelle.html and I didn't really have any problems after that.
  15. Where did you read this in the specification. What little I did look at RSS so far, I have seen in multiple places that it's the correct way to do it. You need to have the html entities in order for it to be "validated". Correct me if I am wrong, were did you read this at specifically.
  16. Please rephrase the question, it is not very easily understandable. Please also put all relevant code in code blocks so it's easier to discern using phpfreaks syntax highlighting.
  17. Looking over just the code you presented there, there doesn't seem to be any issues related to the PHP verrsion. It should fully support 4 and 5. What other things have you tried, why did you originally come to the conclusion it was just the php version that was causing the problem?
  18. Well actually they were right. If you wnat to strip out all tags except a few then you want stripped tags. $variable = striptags($variable, $allowed_tags);// allowed tags being an array of the allowed tags This will clean the variable of any tags you do not specify as being "allowed".
  19. I am not trying to intrude on the post. However it seems that this might be a person called "malice" that use to start trouble on the forms. I am pretty sure if you keep answering his questions he is going to continue running you around in circles. He does that to try and make people look stupid, just my advice. If I am wrong I apologize for interrupting.
  20. I am understanding a little bit about what you mean, however not all of it. Could you please rephrase the question a little better and give some better examples.
  21. Ah, this is perfect. Thank you. In order to get a printer friendly version, that can be setup with a .css file. Have the CSS as media type print. Then style it to look good in a printer.
  22. I have seen links that said click here to print. When they are clicked it activates your printer. How is this setup, PHP, or something else.
  23. I have seen a hosting place that started at a minimum of 500. They have plans that go as high as 2400
  24. If they ads covered the code blocks it would be worse. However they do that to prevent it from causing a problem. None of the ads are of adult material so it's nothing offensive. It's really nothign to worry about. As far as code blocks, all it does is ad an extra 2 seconds (or less) to scroll down past the ad, and in most instances you don't even need to do that.
  25. I have no idea. When I used lightbox awhile back, there are no configuration opens to do this. Chances are you are going to have to get into the programming, and do some modifications. Just look for any settings related to setting those buttons, see if any options exist to make them at the top.
×
×
  • 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.