Jump to content

kate_rose

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by kate_rose

  1. Thanks for the link. I will check it out. I do have a database in mysql. After the user completes a form saying what kind of pics they want to view php connects to mysql and assembles a list of the pics into an array. I am not sure how having a database helps me get any closer to the display part though. If you mean by storing the images in the database, I really don't want to do that because I have 100s of large images and it will make my DB enormous. Could you explain?? K-
  2. I have an array with the names of the images I would like to display & I have a folder containing the images I would like to display. I just need the user to be able to see one image at a time and give them a forward & back button so they can scroll through them. I have written the forward & back php script to rotate through the array but I am now a bit stuck. I have looked at a bunch of tutorials but most are pretty complex. I just want to figure out how to pass the image name back to html & wait for a button click before sending the next one along. I know this is a NewB problem but thats because I am one. If someone could please point me toward a tutorial or example that would head me in the right direction I would greatly appreciate it. Kate
  3. Thanks, This is my first php script so please excuse my ignorance. Kate
  4. I have found exactly this search but the problem wasn't quite the same in that they were using the variable as the value to test against instead of the variable itself. I just can't seem to figure out how to make this work. Not sure that totally made sense but you will see in my code. It is the query statement that is giving me the error. If I replace the $show_this with actual values contained in the mysql table it works just fine. I have checked to make sure $show_this contains data which is a valid column in my database. The error is: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\Guana_Plant_Key\browse.php on line 28 <?php foreach ($to_show as $show_this) { // load links or jpeg names from guana_plants db into $picmysql $query = "SELECT "$show_this" FROM guana_plants WHERE "$show_this" <> 'none' AND "$show_this" <> '"$show_this"'"; $result = mysql_query($query); } ?>
  5. OK . . . What I understand is If I write my form as a function & then call it into the main php file then the php will just run right through it without allowing the user to input anything. I like the idea of using a function because it makes the main script much cleaner and its easier to see whats going on. I guess I can code it all in html though if neccesary. I thought I read that this could be done as a function though. Am I just confused??? Sorry to be so dense this is my first attempt at a php script as well as using a form to get user info. Kate
  6. Duh Thanks Barand. Ok now we are back to my original question. The form is now displaying but it doesn't wait for user input. Instead it just runs through the whole script so the form isn't validated and it redisplays it with the error message I created in the "else" part of of the validation statement. So the end result is you see the form twice and then get the error message. Is there a way to make the parser pause to allow the user to fill in the form before it redisplays it with the error message? Thanks, Kate
  7. Thanks violent. There is something else wrong with my validation statement probably in the "and" part though I can bypass the second half just by making it into a comment which I did so I could see if the form would appear. apparently I have something else wrong with my code because when it gets to the end of it all it gives me this error Parse error: syntax error, unexpected $end in C:\wamp\www\Guana_Plant_Key\test.php on line 95. It was running through fine before I started to include the forms and validate them. What does that error mean??
  8. I have a form which I know displays correctly but when I call it as a function to my php file it doesn't display. Do I need to tell the parser to pause & wait for the user to fill out the form prior to executing the rest of the script? If so how do I do that? OR the error is apparently on the validation line which I thought was caused because the $POST array didn't get a chance to be created by the form submission. If the parser goes through every line of code to validate it before executing it could just be a syntax error in the validation line. The error I get is: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\Guana_Plant_Key\test.php on line 14 Here is my code <?php include ("functions.php"); $to_show = array(); // make checkbox storage array - list of pics to show $to_show = $_POST["to_show"]; $group_by = $_POST["group_by"]; browsing_form (); if (array_key_exists('_submit_check' $_POST)) and if (array_key_exists('1' $_POST)) { //execute a bunch of code here } else { browsing_form (); echo 'Please use the submit button to submit this form and make sure one type of picture is selected.'; ?> One other question. Assuming I get this working and the user messes up the first time they submit the form so the else part of the function gets activated will the program then go back and execute my "bunch of code" or do I need to put it in again after the else statement?
  9. Thanks Guy I am going to turn in now before I make any more stupid mistakes. G'Night
  10. Hi, I am trying to write a function to create a checkbox. So as part of that I need to print <form method="post" action="<?php $_SERVER['PHP_SELF'];?>"> my code is [code/] print ("<form method=\"post\" action=\"<?php $_SERVER['PHP_SELF'];?>\">"); I must be not spotting a reserved character but for some reason I don't see it. Probably just working to late . . . please help Thanks Kate
  11. I will give that a shot. Thanks. I just sort of needed a direction. Kate
  12. Hi, I have a bunch of different sized images (some much bigger than the screen and others which will only take up part of it) that I need my users to be able to go through individually. Since the details are important scrolling will be OK. So basically I need to have a forward & back button and a display of the pics. The list of images will be generated from a database depending on the user query. I need it to be cross browser compatible so I guess a CSS design which I would normally go to is pretty much out & I have read that javascript should really be considered an extra because some folks turn it off or don't use it. So it just needs to be basic html & or CSS which will work with IE. There is a dizzying array of scripts out there could someone please point toward one or a tutorial that could help. Sorry to be so nonspecific I am really new at this. I have figured out the php scripting for the most part but the image display is the next step. Thanks Kate
  13. Wow that was amazingly fast . Thanks everybody for the help. I guess this one is solved though I don't know how to put the green checkmark on it that indicates that. I am sure I will be back for more. Maybe even momentarily when I try to run this again. Wild, by the brackets I assume you mean the <?php ?> If so you needn't reply. Thanks again Kate
  14. Hi, I am trying to debug my first php script. When I run it I get the following error Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\wamp\www\Guana_Plant_Key\test.php on line 52 I am running all of this on my pc on wampserver. I tried looking up the error but I couldn't find an example that matched my situation. I have included my script up until the error just for completeness. It is getting stuck on the last line. I am just trying to get the numerical index of the entry in the array being accessed. Is "key" the wrong command. I looked through the manual & couldn't find a good alternative but I may have missed it. Kate P.S. Sorry for the excessive remarks - Since I am just learning it helps me keep track <?php // sets variables for opening guana_plants $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'guana_plant_db'; // connect to mysql to use guana_plants $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname); $seperator = " ~ "; // define seperator $picstorage = array(); // make link or jpeg output-storage array $scinamestorage = array(); // make scientific name storage array $comnamestorage = array(); // make common name storage array $comnamemysql = array (); // make input from mysql common name array $scinamemysql = array(); // make input from mysql scientific name array $picmysql = array(); // make input from mysql link or jpeg storage array $picexplode = array(); // make temp array for exploding // load links or jpeg names from guana_plants db into $picmysql $query = "SELECT flower_pics FROM guana_plants WHERE flower_pics <> 'none' AND flower_pics <> 'flower_pics'"; $result = mysql_query($query); while ($row = mysql_fetch_array ($result, MYSQL_NUM)) { $picmysql [] = $row [0]; } // load scientific names from guana_plants db into $scinamemysql $query = "SELECT Concat(genus, ' ', species) FROM guana_plants WHERE flower_pics <> 'none' AND flower_pics <> 'flower_pics'"; $result = mysql_query($query); while ($row = mysql_fetch_array ($result, MYSQL_NUM)) { $scinamemysql [] = $row [0]; } // load common names from guana_plants db into $comnamemysql $query = "SELECT common_names FROM guana_plants WHERE flower_pics <> 'none' AND flower_pics <> 'flower_pics'"; $result = mysql_query($query); while ($row = mysql_fetch_array ($result, MYSQL_NUM)) { $comnamemysql [] = $row [0]; } foreach (picmysql as $pics); // begin to go through the array 1 entry at a time if(strstr($pic,$seperator)) { // If $pics contains the separator execute $picexplode = array(); // Reset $picexplode to an empty array $picexplode = explode(" ~ ", pics); // explode any string with a ~ into the picexplode array $count = count ($picexplode); // count number of link or jpeg names in $picexplode $countedlinks = $countedlinks + $count; // add count of link or jpeg names to $counted variable so I will get # of links $1key = key ($picmysql); // load the location or key of the current link or jpeg name into $1key
  15. Thanks Guru I appreciate the info. Sorry I misunderstood.
  16. So if I want multiple users to be able to use the id program on line at the same time I need to store them in the db?? Sounds like a bad idea all around but I would like to accomadate multiple users if possible.
  17. Hi I am trying to retrieve data from a mysql database & there are '\' in the data because they correspond to an image location on the computer (i.e. 'myfolder\myimage') I tried replacing all the '\' with '\\' in the db but I am getting the same error which is Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\wamp\www\Guana_Plant_Key\test.php on line 28 Is it the '\'s in the db causing the problem or do I have some other coding error?
  18. I was wondering what the advantages are of storing images in a mysql data base versus retrieving images stored on the server. Which is better? My application: I am developing a web browser based plant ID system that I want to run on & off-line. It will be heavily reliant on images. I am planning to create a CD with all my images for offline use & I will probably include wampserver so in can be run offline. I could alternatively store those images in mysql. I have heard that mysql retrieval of images takes longer. Does it take a lot longer?? If I have a lot of images would it significantly affect their load time? I also want my users to be able to upload & save their photos for comparison purposes. I want the database to be dynamic in that the user could add to or shape the visual elements of the ID system. I also want to be able to update it as I acquire new images & add plants. I have also heard that mysql is better for user upload because of complications with the paths. True?? I would love to hear your opinions & any info you have to share. Thanks, Kate
  19. I am running wampserver. I have created a mysql database. I want to get a single column of data from my db and load it into a php array. I have looked at a number of example scripts but none seem to do what I want. I have a mysql book & I pretty well understand how to retrieve data in the mysql console. When retrieving data from mysql using php do I have to use one of the preset commands such as 'msyql_fetch_assoc'? Or is there a way to send mysql commands directly to get a column of data & put it in a php array without using a where loop in php? It just seems really cumbersome. As far as I can tell all the php mysql commands retrieve a whole row of data. At the console you can specify exactly what data you want and can get data from only one column. I guess my main problem is that I am new & I don't understand exactly how php & mysql interact. Could someone please provide an explanation or refer me to a link. Don't mean to be dense, Kate
  20. OK here goes. I am using Firefox 2.0.0.1.4. & all the functions seem to be working. Good stuff - I liked your intro about not having to sign up but most of the things didn't work without signing up Also liked the logo and immediate presentation enough to enjoy reading the intro blurb. No color though :-\ The intro could be improved by making it quick to get the info you are providing "Why stay on this site???" - no sign up required - you will be entertained + fun chat on cool topics (make "cool topics" a link so they can get right to it) + view wacked out videos & optical illusions (whatever you think will entertain) connection to UTube - etc. Would I stay. Probably not. Why not? As a user hoping to be entertained I want an immediate link to a fun game or experience that will hook me. You still want your main content to stand out & things not to get to cluttered so maybe put the main content area in color & put the links to games that will hook me with fun black & white graphics. I don't know much about how to do it but it would be great if users could at least look at topics being discussed & see what people are posting. It might even be nice to give them a sign-up free chance to connect with folks in chat say 10 post limit so they could immediately chat if they wanted to. I guess this might get abused but until you build up your clientel it would be attractive at least to me. It could always be changed later. Hmm. . . I could probably come up with more but I am procrastinating . . . Kate
  21. Not sure you were looking for design input (if not please ignore). On your links to the twisted steel software etc. instead of sending the user to a page where they must then click to get to twisted steel provide a little more upfront information & send them directly there. I think users are all about that immediate gratification & you could loose some. Kate
  22. Hi, I am new to php & mysql. I am trying to develop a web based plant key. I need to convert my excel database with all the info in it to a mysql database. I have tried to find a converter online and there are a lot to choose from (kind of hard to sort through them all). All the ones I have looked at have limits on the number of columns that can be imported and my database is pretty big. Do I have to chop it into bits and put it back together in mysql? I definitely want to try the converter before I spend any $. Can anyone suggest a program and shortcut my search time. Freeware would be great if possible. Thanks, Kate
  23. I figured it out. For future reference Skype conflicts with wampserver because it uses port 80 which Apache needs. I have only a vague idea of what this means but I had to uninstall Skype (which I don't really use anyway) & restart. Wha-lah the welcome page appeared. Thanks for the help Kate Not sure how to put a solved check mark on this?
  24. I just uninstalled, deleted, and did a vodoo dance to drive all wamp spirits from my computer. Then I redownloaded the wampserver, Restarted the computer & reinstalled wampserver. I am still not getting the welcome page. I did notice while searching for wamp files that there are wamp related files in dreamweaver. Could they be conflicting?? Such a basic thing. One would think I would get hung up on the more complicated stuff . . . ??? K-
  25. I get a totally blank page in my web browser with no error message at all. Any chance Firefox could be conflicting with wamp?? Kate
×
×
  • 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.