litebearer
Members-
Posts
2,356 -
Joined
-
Last visited
Everything posted by litebearer
-
Image display in a div reading image filename from database
litebearer replied to colap's topic in PHP Coding Help
Strange, the demo works fine. Please show us your code. -
blank fields are replacing/updating others?
litebearer replied to andy_b_1502's topic in PHP Coding Help
since you are UPDATING the record, why not populate the form with the existing data? That way data that has been modified will update the appropriate fields; while data unchanged will simply be populated with its original content. BTW just because the user is registered and editing their own data does NOT mean you should skip validating and sanitizing the data. -
Perhaps let the "REGISTERED" users upload the pics via form. db table id, image_name, user_id, approved. set approved to 0 for NOT approved yet. When user uploads pic, move to folder, add to db, send email to Admin that image has been uploaded. THEN when Admin reviews the unapproved images she/he can either delete the image or change approved to 1. When displaying the pics, set filter to only show pics where approved = 1.
-
Thank you! That is/was the problem. I had always presumed that file() returned an array using the newline as the delimiter (and did NOT include the newline as part of the array elements). Thank you again!!!
-
I can't seem to understand why in_array is NOT finding the 'needle'. php file: <?PHP $search = "WS11"; $valid_codes = file("outcode2.txt"); if(in_array($search, $valid_codes)){ echo "yes"; }else{ echo "No"; } echo $search . "<hr>"; echo "<PRE>"; print_r($valid_codes); echo "</pre>"; ?> outcode2.txt: WS10 WS11 WS12 WS13 WS14 WS15 WS11 is in the outcode2.txt It is not an issue of case. Perhaps my old eyes just keep missing the problem. Any help is appreciated.
-
Is it okay to use a Function to output HTML?
litebearer replied to doubledee's topic in PHP Coding Help
There are times when one must blend/merge/use php within htlm output. it is not a question of separating logic FROM html. what if your options were numbers rather than html code? (rhetorical) Your function is a logical function. Consider when one is echoing a result set from a query - is that logic or presentation? (also rhetorical) -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
Also, try this... replace this: $qry = $sql->sqlStart.$sql->stmt.'Group By property.id'; with this... $qry = $sql->sqlStart.$sql->stmt.'Group By property.id'; echo $qry; exit(); and tell us the results -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
for the moment, replace this echo "<a href=\"{$row['url']}\"><img class='image1' src=\"{$row['image_path']}\" alt=\"{$row['summary']}\"> </a> <br />"; with this... ?> <a href="<?php echo $row['url']; ?>"><img src="<?php echo $row['image_path']; ?>" alt=""></a><hr> <?php -
@Thorpe = always with the common sense - sheesh! What fun is that?
-
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
I flipped the closing tag <?php /* put your database connection here */ $query = "SELECT * FROM images"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { ?> <a href="<?php echo $row['url']; ?>"><img src="<?php echo $row['image_path']; ?>" alt=""></a><hr> <?php } ?> -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
Save this as test.php (make sure to include your database connection) then point your browser to it <?php /* put your database connection here */ $query = "SELECT * FROM images"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { <? <a href="<?php echo $row['url']; ?>"><img src="<?php echo $row['image_path']; ?>" alt=""></a><hr> <?php } ?> -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
look at the browser source code and see what it has as the link destination. post that here -
Doesn't post it in the database :( (HELP PLEASE) ):
litebearer replied to buzzern96's topic in PHP Coding Help
try changing this... $sql = "INSERT INTO girl (`girl`,`accepted`,`ip`,`sex`) VALUES ('$name', '0', '$ip', 'Female');"; to this... $sql = "INSERT INTO girl (`girl`,`accepted`,`ip`,`sex`) VALUES ('$name', '0', '$ip', 'Female')"; -
Doesn't post it in the database :( (HELP PLEASE) ):
litebearer replied to buzzern96's topic in PHP Coding Help
post most recent code -
Doesn't post it in the database :( (HELP PLEASE) ):
litebearer replied to buzzern96's topic in PHP Coding Help
@jesirose see post 5 second script - using back tics on the variables -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
no, it will be where you want to display the images so the user can make their choice -
Doesn't post it in the database :( (HELP PLEASE) ):
litebearer replied to buzzern96's topic in PHP Coding Help
A) in your query, REMOVE the first semi-colon B) use back tics for your field names and single quotes for your variables test it and tell us what happens -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
if each link has the unique property id corresponding to the image, then yes. -
Doesn't post it in the database :( (HELP PLEASE) ):
litebearer replied to buzzern96's topic in PHP Coding Help
immediately after this... $sql = "INSERT INTO girl (`girl`,`accepted`,`ip`,`sex`) VALUES (`$name`, `0`, `$ip`, `Female`);"; add this... echo $sql; exit(); and tell us what you see -
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
echo "<a href='view.php?id=" . $row['id'] . "><img class='image1' src='{$row['image_path']}' alt='{$row['summary']}'></a> <br />"; view.php <?php GET the id connect to db query db for that paticular id display the results ?> -
follow this similar thread http://www.phpfreaks.com/forums/index.php?topic=358846.0
-
How to make a image a link when it is outputted using PHP?
litebearer replied to usman07's topic in PHP Coding Help
Rough overview... 1. make each link to view.php passing property id via url 2. make view.php page that: A) $_GET the id being passed; B) queries the db for that particular id; C) Displays the query results -
find this in the script... .box_gallery { text-align:center; position:absolute; top:0; right:0; z-index:1000; overflow:auto; } and change top:o; to top:whatever height of banner is plus 10 pxs
-
IMHO from perusing the script, you will need to make adjustment(s) to the formatting class(es) the script uses, allowing for a div above the image content (which div will contain your banner). This is beyond my capabilites. I would suggest posting this in the CSS section of phpfreaks