Jump to content

aleX_hill

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Everything posted by aleX_hill

  1. I agree that having a working server on your local computer is a necessary requirement. There is nothing more off-putting then having to upload your file each time you want to change a semi-colon. I use xampp personally, and it works great. Take a look through a lot of examples and tutorials. There are some great tutes out there that explain in depth how things work. Dont jump too far into things. Get used to if/else/while etc before you attempt to learn classes, or write a forum for example. mysql is also a valuable addition, but make sure you have the basics of php down pat first.
  2. I would still get the item from the database, so in your case keep the code you have, and just put the if statement just before you output the data. So, get each category, then under each category get each item, but if that item's id = 6, just dont output anything.
  3. sadr: The contents of the uploadify file are not displayed, so what I did was hard code in some mysql connection details, and try and write the session var to the db (to see what the session var contained), i got blank (although the write to db worked) ohdang888: yes they are. When the user logs in I include a particular file based on their user group, this included file sets the session vars or db_user, db_server, db_table etc. I cant see a way of hardcoding into the file at the moment.
  4. I just had a look through your posts and found the following code, which I assume you are using. I have put the if statement in for you. ?php $result = mysql_query("SELECT * FROM cat_foodmenu ",$connect); while($row = mysql_fetch_array($result)) { $id = $row['id']; $title = $row['title']; if($id != '6') { echo '<h1>'. $title . '</h1>'; $result = mysql_query("SELECT * FROM food_menu WHERE cat_id='$title' ORDER BY id ASC",$connect); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $title = $row['title']; $price = $row['price']; $info = $row['info']; echo '<div class="recipe"><span class="name_of_the_recipe">' .$title .'</span>'; echo '<div class="price">$' . $price .'</div>'; echo '<div class="recipe_bg"> </div><div class="clear_container"></div></div>'; echo '<p>(' . $info .')</p><br />'; } } } ?>
  5. There isnt a lot of information here on what you are trying to do, but I assume something like this will work (although I am not the best coder, so there could be a more effective way). while($i=0; $i<$numberOfIds; $i++) //Cycle through each "thing" { //do something here to initialize the $id variable, maybe get some mysql information if($id != 6) //If the id is 6, we will skip it { echo $id; } } If you give a little bit more info I can try and expand.
  6. Hi All, I am using the uploadify script available at http://uploadify.com/ Now I can get the file uploads working fine with the script below: <?php session_start(); ?> <link href="/uploadify/uploadify.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="/uploadify/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/uploadify/swfobject.js"></script> <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.0.min.js"></script> <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'auto' : true, 'folder' : '<?php echo $_SESSION['filepath']."/downloads/"; ?>', 'multi' : true }); }); // ]]></script> The problem that I am having is that I also store the mysql connection details in session vars (they change depending on who logs in). I have tried a number of ways of "passing" these session vars to the uploadify.php file which does the grunt work of the uploading, but I can never seem to access them. I obviously dont want to pass them to the uploadify.php script through the js because that will show my credentials in the source code. So, the question is, how can I access these session vars in the called file. I assume its a combination of session_write_end() and session_start() but I havent got the right combination yet.
  7. OK, this might be more of a mysql query, but I think I am more looking at the PHP side of things to figure it out. I have a sql database with the following structure: id start_date end_date file Then there is a php page which displays "file" if todays date is within the "start_date" - "end_date" range. I also have a form with the three fields to upload into the database. The problem I have is that the display page only has room for 2 files, so I want to warn/disallow the user if there are more then 2 files scheduled for any day. I am not really sure about how to do this. In the upload page i have a listing of all the current files, so i am thinking that in populating this table I can check for duplicates and notify the user, but I am not sure how to check the ranges properly. Any light shed on this will be a big help. Cheers
  8. I am looking at selling a PHP application which is quite large (uses the dojo ajax toolkit). I was hoping to run the app from the end users local machine. I am not overly worried about source code etc because the people I am selling to have little IT knowledge in this area. The problem is that with their limited knowledge I dont want them to have to run apache etc. Is there an application which will allow them to use the PHP app like an executable? Or a way to install a "program" which will load apache in the background and then open up the local copy of the app? Any thought on going about this would be appreciated.
  9. Does anyone know of some freeware (windows) which manages multiple sites and allows FTP transfers similar to the dreamweaver style of site management? I think I used a PHP oriented program a while back, but cant remember the name. Cheers, Alex
  10. I guess I could use the same while loop to add files from the folder to the database and run as a conjob or similar... looks like I have some more work to do. Alex
  11. In that case, do you know any file uploaders that will put the files in a database? At the moment I FTP the images to a dir, and just read the files straight from the dir. Alex
  12. Can you suggest a way of doing this? I was thinking of using $_POST but I think that would need a javascript routine to pass the $_POST through to the phpThumb.php ? Thanks, Alex
  13. I dont know if anyone uses phpThumb, so I will explain the usage anyway. Usage: <img src=phpThumb.php?src=source.jpg&h=150> I am trying to hide my image url in the source, so I am trying to put the src into aa $_SESSION. In my while loop I have done this: $_SESSION['src'] = "path_to_file"; <img src="phpThumb.php?h=150"> and in the phpThumb.php file: $_GET['src'] = $_SESSION['src']; This works fine for the first image, but this image is repeated every time. I have tried putting a &rand=$rand on the end of the url in the <img> tag incase cache was the problem, to no avail. The session var is updated correctly, I am sure of that. Can someone tell me why phpThumb is not updating the image each time? Thanks, Alex
  14. Can someone point me in the direction of a script that will read the contents of a folder (they are all images) and then put them in a table, with pagination? I have a script that will read the files and put them in a table, but dont know how to start from half way through the folder on page 2 etc (without first making x readdir requests). <?php // Type in the full / absolute path to the folder... $path = $_SERVER[ 'DOCUMENT_ROOT' ] . "/clients/client1/"; // This opens the folder... $dir_handle = @opendir($path) or die("Unable to open $path"); ?> <table><tr> <?php $i = 0; // This loops through the files... while ($file = readdir($dir_handle)) { if($i == 4) { $i = 0; echo "</tr><tr>"; } if($file == "." || $file == ".." || $file == "index.php" ) continue; echo "<td><img src='client1/$file' height='400'></td>"; $i++; } ?> </tr></table> <?php // Close it... closedir($dir_handle); ?> Any help is greatly appreciated. Alex
  15. Thanks for that. Knowing what does it makes gogle searches a lot easier... Searching for "Convert ? to / in PHP URL" doesnt get you much. Thanks.
  16. I have seen a few sites which do not use the following syntax for URL parameters: page.php?param=value Instead they use something like page.php/param/value or something like that. How can I go about converting the first style to the second (or similar) Thanks, Alex
  17. Hi, I am reasonably new to using MySQL. I am looking at designing a site where each user lists a lot of items (similar to a gift registry). Is it normal practice to make one big table (ie "gifts") with the user (id) as a field, or create a new table for each user. What is the best thing to do, assuming that I use one table, when this table becomes to big? Thanks in advance, Alex
  18. Hi, I am looking to do something like: include('file.php?id=1'); This doesnt work, is there a way to do something like this? Thanks, Alex
  19. Rommeo, I am assuming that you mean that in your css code, does it matter whether you define #body styles before or after #footer styles. In the long run, it does not matter which way you define them. Where it does make a difference, though, is if you redefine a style. If you have a #footer at the top of your document, and a #footer lower down, the styles in the second #footer will take precedence. I always suggest laying out the code in the same fashion as your html document as it makes things easier to find. Alex
  20. I am not a web design and development company as such. I am one person business which creates website for family, friends and schools which I have other contact with. I was creating the HC Web Designs site as a project for myself to learn more about scripting, hence asking for help here. I do not advertise myself as a business, I just make basic sites for people I know. As for the criticism, about the site, thank you to those people who have been constructive. It is disappointing though that people from this forum, which should be supportive, have abused the me through the forms. The website is a work in progress, therefore there is no error checking on the forms as so *kindly* pointed out by Mr f**ker you. In the future, if you do not want to be contructive, please do not abuse me, I am just trying to learn how to do things myself. Alex
  21. I am using BlendTrans to fade some images on my site, then make them full colour on mouseover. (www.hcdesigns.com.au and click on portfolio). The fading should be done when the page loads (the a href calls the page, then fades all the images). The problem being that when the page loads for the first time, they dont auto fade. Once the page is loaded, then you go to another page and come back, it works properly (well in IE, still not FF). Can someone help me get them to fade straight away? Alex
  22. Hi, My page www.hcdesigns.com.au displays fine in IE, but has a couple of problems in FF. Firstly, the footer div is too wide at the bottom and sticks out to the right. Secondly, the white background colour of the mainContent div only goes partway down the div (I think it is the size of the first div in there as it is updated using AJAX when you click a menu item). Can anyone help me fix these annoying problems? Cheers, Alex
  23. I solved the problem... The js grabbed the current image in the header. and set it to a global var. This was then used in the revertImage function. The var wasnt getting the src though because the rollover was called before the source was displayed. Thanks for the help.
  24. Agreed, As PHP is server-side, by the time javascript is parsed at the local browser, the PHP has done everything it needs to do. The way I do it is save the script in an external .php file, and use: <script language="Javascript" src="path_to_php_file"></script> This works for me.
  25. rajivgonsalves : The "javascript:" is only in the href= section, not on any events. fenway : How would I disabe rollovers until the page has loaded? (I am only new to js). Thanks
×
×
  • 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.