Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. About php, I know a lot, the thing's I am starting to look into now, are things I see other people talking about. Object Oriented Programming, my experience level with PHP in general is rather high. I can program a high end, backend with little effort, because I know php/mysql to the point of being good at it. The things I am focusing on looking up/learning now are 1. Object Oriented Programming 2. I already built my framework, I am looking into making it more like a templating engine here pretty soon. 3. The 2 types of patterns that were spoken about, don't remember hte letter's for them now, but I am looking into those (one point of input and one point of output) I have been checking into that Those are the things I have been working on lately.
  2. I will try that tomorrow, and see if it works thanks.
  3. [quote]Ah, okay, so you're looking to do something like this: Code: function change(bottomimg) { document.all ? document.all["featuredimage"].src = document.all[bottomimg].src : document.featuredimage.src = document[bottomimg].src; } I'd be surprised if the more experienced people don't have a better or more proper way to do it, but sorry, that is all I have.[/quote] I don't like using that style, it's all shorthand, and look's very ugly on the eye's. [quote]Sounds like you're trying to pull info from this DOM object before it's finished loading.[/quote] I don't activate the rollover until all image's are loaded, and everything is finished loading. I don't understand why it's not working Any more advice would be greatly appreciated.
  4. I guess it is time for me to start looking into that.  MVC patterns. I have been avoiding it, also I have been avoiding classes/objects. I have not been doing functions too long, with my framework, but maybe it's not a bad idea to go ahead and get things organized.  Thanks for all the advice, that was quite a bit.
  5. bottomimg is suppose to simply be the name of the image. Through the function I pass bottomimg as the variable name, it's suppose to replace that with the number or value I insert in there, but if that's not working then I am confused.
  6. I am slowly over time, but now I was just asking about general coding style, specifically related to that specific technique.
  7. Above was the javascript code, below is what I could get of the image's It is sort of having problem's letting me post somethign htat is somewhere in my code. [code] while  ($image_row = mysql_fetch_array($image_query)) { $height = "height=\"70px\""; $width = ""; echo "<a href=\"#\"><img src=\"/oakley/{$image_row[pathtofile]}{$image_row[filename]}\" alt=\"{$image_row[filename]}\" {$height} {$width} name=\"{$image_row[imageid]}\" onmouseover=\"change({$image_row[imageid]})\" /></a>\n"; } echo "</td></tr></table>"; ?> [/code] That is where my image's are getting output at.
  8. [code]<script type="text/javascript"> function change(bottomimg) { document.featuredimage.src = document.bottomimg.src } </script>[/code]
  9. it won't let me post so I have to do it retardedly this time. I went over the logic of this code, 4-5 time's at first, because I really had no idea how I was going to achieve this. http://www.s162063332.onlinehome.us/oakley/property.php?pid=8 On this page, it lists a property based on id, obviously this is property 8.  Now based on this url, it will pull up that property and all images associated with that, but there need's to be a dynamic rollover affect using javascript.  I had no other idea as to how to get it to know which image is which, so I created a function for it.  It's not working though when I roll my mouse over an image and look up firefox's javascript console, it tell's me [quote]Error: document.bottomimg has no properties http://www.s162063332.onlinehome.us/oakley/property.php?pid=8 Line: 15[/quote] It tell's me this everything single time I mouse over. If anyone can help me figure out what is going on with this I would appreciate it.
  10. Yes, that was what I meant, but I never used it, I didn't know it produced a fatal error. So in essence you must have been using session_start(); this whole time and not realized it until now.
  11. Ok, I am starting to see multiple way's of programming. I have my own style's (Granted) I don't like anyone putting down my personal style of programming obviously.  However I have seen some specific style's I like, some I specifically find disgusting.  I know it's a matter of opinion. However I am trying to decide on. One way I didn't like was this obsessive php mode.  <?php // echo everything on the page ?> I personally like having some xhtml, some php in different places. One thing I have noticed, when I decide that I jsut want to echo php, or larger portion of echo's.  Echoing the xhtml I mean.  I sometime's notice people put more of it in a variable. I am wondering, is that a good way, I am starting to like it. for instance.  Someone might have. echo "<a href="#"><img src=\"/oakley/{$image_row[pathtofile]}{$image_row[filename]}\" alt=\"{$image_row[filename]}\" height=\"70px\" width=\"\" /></a>"; Ok this is a total echo of the whole thing, no questions asked. Then here, I saw someone do this echo "<a href="#"><img src=\"/oakley/{$image_row[pathtofile]}{$image_row[filename]}\" al well you get the picture, instead of havingt alt="" he would have $alt and he would have alt in a variable like $alt = "whatever" then pass that through the echo I use to do that then I saw someone with total variable [code]<?php $firstpart = "<a href=\"#\">"; $height = "height=\"70px\""; $width = ""; $middlepart = "<img src=\"/oakley/{$image_row[pathtofile]}{$image_row[filename]}\" alt=\"{$image_row[filename]}\" {$height} {$width} />"; $lastpart = "</a>\n"; echo $firstpart . $middlepart . $lastpart; ?>[/code] When I saw that, I was unsure if I liked that better, or if I liked instead, having the echo natural, then having just some of the attribute's to some of the tag's as variable's to make the code easier to edit?  Which way do you prefer, or do you have some alternative way's
  12. It's hard to believe php would let you get away using the wrong one all this time. Most likely you were and just don't remember, unless your server had some crackheaded setup, or there is a setup info in the php.ini that can set session_start to stay on all the time, maybe on all your other server's that was inabled, so start_session (incorrect name) was called, it was ignored but everything still worked, because the ini had it set too.
  13. As far as I know that can't be done. I am not sure, it probably can, but i have jumped from webhost to webhost before, and everyone makes you login to control panel, and login seperate for php myadmin.  You would have to get to phpmyadmin source file's to be able to do that, It would depend on your hosting enviroment I suppose.
  14. I created a logical structure for the usergroups, and the posts.  I have everything setup the way I need, there are different groups, and different groups have access to different part's of the forum's just like they wanted.  How can I take a user, already signed in, and log them into the forum based on that, and choose what school they are a member of in the forum based on what school they signed up for on the website, is there an easy way to do this.
  15. actually I didn't realize that, I had forgotten about my friend the docroot variable I had created.  it works perfectly.  Hmm thanks.
  16. I tried it with the / and without the / in front of oakley On this server he has oakley this is the root. So the way it's set up, all the file's are inside oakley. THe file is writable, I made sure of that, I just understand now why it's working.
  17. The reason I am not, is because I don't know how. I have "always" had trouble's with file uploads.  Every single time I try I run into problems' I think doing array uploads will make it even harder for me specifically until I master how they work. For instance, right now I ran into a problem [code]<?php $target = "/oakley/propimages/"; // prepare target url this is the same for all images,(since it // is the same location on all images) $file1 = $_FILES['file1']; if (!empty($file1['name'])) { $tmp_name1 = $file1['tmp_name']; $name1 = $id . "_" . $file1['name']; $target1 = $target . $name1; if (file_exists($target1)) { echo "File 1 already exists.<br />"; }else { if (move_uploaded_file($tmp_name1, $target1)) { echo "File was uploaded successfully.<br />"; }else { echo "There was a problem uploading this specific file.<br />"; echo $tmp_name1; echo $name1; echo $target1; } } } else { echo "File1 does not exist | "; } ?>[/code] Once I get this working I am going to replicate it for the rest. I tried this one code, the reason I am doing it this way, I have to rename the code for each image to the propertynumber_imagename I am having to do that on all of htem, I used that code up there, and tested it out on the first upload, and got this error. [quote]Status on File 1 Warning: move_uploaded_file(/oakley/propimages/1_cup.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /homepages/30/d162063315/htdocs/oakley/admin/addimages2.php on line 77 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php3H9i9j' to '/oakley/propimages/1_cup.jpg' in /homepages/30/d162063315/htdocs/oakley/admin/addimages2.php on line 77 There was a problem uploading this specific file. /tmp/php3H9i9j1_cup.jpg/oakley/propimages/1_cup.jpg[/quote] the variable echo's that was only for debugging purposes by the way
  18. Of course I will, it make's less typing, I was just making sure I understood it right.
  19. so me doing $file1 = $_FILES['file1']; the I can access all the variables using like $file['file1']['name'] and $file1['file1']['tmp_name'] like that is that why you grabbed them all.
  20. 100% perfect.  Exactly what I needed.  I owe this one thank's to you, I was having a hard time explaining it.  Thanks, if you hadn't of then I would have been fighting with this awhile. Thanks again this is exactly what I needed.
  21. I am not explaning it right.  How do I test to see if they put something in the little box where the file is. <input name="file1" type="file" /> there is a blank line there, if they upload a file it fills it with the filename of there server, if not it sends it blank, I just want to check to see if they clicked upload, and picked a file, for that specific one before hitting submit.
  22. The reason I am wondering about doing it the long way. I want to get solid with working on file's I don't work on them often, I am still weak at them.  I want to get a lot better at individually working on seperate file's then later i will start doing it with an array.  Right now I just want to 1 at a time test to see if each file was uploaded. Like this if (they attempted to upload file1) { // validate file, rename file, move file }else { // ignore existence } if (they attempted to upload file2) { // validate file, rename file, move file }else { // ignore it } if (they attempted to upload file3 ) { // validate file, rename file, move file }else { //ignore it } and so forth for each of the 31 files.  This will get me better at them individually.  THen later I can go in and learn how to do them with array's to make it 4 time's faster.
  23. I know how to access the file's specifically.  I am just wondering hwo to do a test for the file. If they didn't attempt to upload one it doesn't show, if they did, then it tries to work with it. will this work if (is_uploaded_file($_FILES['file1'])) { // validate file // rename file // move file } then if it didn't then it just ignores that block of code?
  24. How do you just test for an upload attempt. If you have a input field, it's it's just <input name="hello" id="hello" type="text"  /> then you can just go if (isset($_POST['hello'])) { // field was filled out. } I need to get the same type of affect with file upload's, but it doesn't work like this, how do I test for it?
  25. I have a form with 31 potential file uploads.  I want to test each file to see if they tried to upload a file, if they did, then I go ahead and check if the file exists, and rename it, or whatever else. I only want ot try to work with file's however they they attempted to upload.  The one's they left blank I want to ignore, but that didn't work, like if it was a text field, that would check to see if it was field out, if it was then I can validate it, it's not working with file uploads. Sorry it was so unclear at first.  trying to deal with 30 file uploads at once has got me feeling a little dizzy, and my head is spinning.  I went from a few huge things today, over to trying to do mass file uploads.  It's been a hell of a day, that's why I sound out of it, sorry about that.
×
×
  • 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.