SharkBait
Members-
Posts
845 -
Joined
-
Last visited
Never
Everything posted by SharkBait
-
I get nothing ;) A Page Cannot Be Found.
-
how I can prevent browse of my images folder
SharkBait replied to isaac_cm's topic in PHP Coding Help
If you manage to block them from getting into your images directory, you could then use .htaccess and an Apache Mod_rewrite and block hotlinking to the images. I don't have my sample of denying hot-linking of images/pdfs because my server is currently down until I go in tomorrow to turn it on. -
What about [code=php:0] foreach($_POST['faq_Model'] as $item1 => $item2) { echo "{$item1} -- {$item2} <br />"; } [/code] Just trying to debug your $_POST['faq_Model'] variable to see what it's storing.
-
You want more of a global variable? Set it ones and then all pages after it's been set will use that value?
-
<title></title> needs to be placed in the <head></head> section of your page. [code] <?php $myTitle = "This is my website"; ?> <html> <head> <title><?php echo $myTitle;?></title> </head> <body> This is where the content of the website goes </body> </html> [/code] As for where you get the information from, it could be set statically like it is in my above example or pulling from a Database such as MySQL which would/could be more dynamic.
-
$_REQUEST I believe is like $_GET which gets their values from a URL. So you would use them like this: [code=php:0] $myValue = $_GET['id']; [/code] The rest of it I am unsure of what you are asking.
-
What do you get when you [code=php:0] print_r($_POST['faq_Model']); [/code] after you've submitted the form?
-
[quote author=jsladek link=topic=115024.msg468199#msg468199 date=1163557993] Just wrote this real quick [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <center> <? foreach (glob("images/*.*") as $filename) { print("<a href=\"$filename\">$filename<br><img src=\"$filename\"></a><hr>"); } ?> </center> </body> </html> [/code] Regards, John Sladek can someone tell me how to put code in the post highliged as PHP. I'm using the [ c o d e] tags [/quote] Just use <?php and ?> inside your [ co de] tags :)
-
Do you submit a form prior to getting to that section with the back button?
-
Check to make sure anywhere above where you issue the header() function that there is no text being sent to the browser. No echo's, print() etc.
-
My eyes are bugging out but let me see if I understand this: You have a database with listings by IDs. You have a folder that contains photos that have a prefix of the IDs that are in the database and a suffix of the image number. Then you want to fix any of the filenames so they they are sequential? You want your script to go into the photo directory, pull all the filenames, fix them and then insert the fixed filenames into the database corrisponding to the IDs correct?
-
I dont know code wise but... You could go through the directory of images with PHP and look at the file names. Create arrays based on the ID from the filename by somehow parsing out the image numbers. 12345_02, 12345_05, 12345_29, 12344_01, 12344_02, 12344_19, 12344_45 would be placed into an array like: [code] <?php $images = array(12345 => array('02', '05', '29'), 12344 => array('02', '19', '45')); ?> [/code] Then you would just have to loop through the array and insert them into the database :) Hopefully the idea is there to help ya out.
-
read is a function of MySQL Enclose read with backticks (next to the 1 key) [code] <?php UPDATE privatemessages set `read` = '1' WHERE id = '{$id}' ?> [/code]
-
Change it to read: [code] <?php $result2 = mysql_query($sql2, $connection) or die("MySQL Error: <br />{$sql2}<br /> ". mysql_error()); ?> [/code] the die() section will stop the rest of the script and the mysql_error() will output what is wrong if its a MySQL issue.
-
Mozilla - Running Query Twice, IE Running Query Once
SharkBait replied to lilman's topic in PHP Coding Help
Can you post the entire code? Do you check for a user_name that is already taken? That would stop the double INSERT at that level. Pehaps there is an odd loop happening..?!? -
Mozilla - Running Query Twice, IE Running Query Once
SharkBait replied to lilman's topic in PHP Coding Help
I haven't seen this happen and I code my sites in Firefox, then check them on IE and then whatever other browser I feel like loading up. If ya want, post the code that you think is looping :) -
Can ya explain what the >> does with the hex values?
-
Ok, I am trying to figure this out, if I enter the HEX color of 336699 that would break down to: Red: 51 Green: 102 Blue: 153 Correct? I would need to split the hex value into 3 values and then convert those to their decimal values right? Would I go about splitting them up every 2 characters, and then convert hex -> dec on those 3 seperate values? Or is there a better way to do this? Thanks.
-
I dont know if there is a better way but I do it like this: [code] $links = "item1 | item2 | item3 |"; substr($links, 0, strlen($links)-2); [/code] I'm sure there is an easier way but I just knock of the last few chacters if you know there will always be 1 or 2 characters after the string.
-
On thing I do with my queries that is easier to debug would look like this: [code] <?php $str = "UPDATE gal_galleries SET title='{$title}',description='{$description}' WHERE id='{$id}'"; // If there is an error the script will DIE and tell you why $query = mysql_query($str) or die("MySQL Error: <br /> {$str} <br />". mysql_error()); // $num will return how many rows were updated from the query if successful $num = mysql_affected_rows(); if($num > 0) { echo " Gallery {$title} has been updated."; } else { // Technically if your query doesn't work you wont get here } ?> [/code]
-
This is an HP SAN (Storage Area Network) Array: http://h18006.www1.hp.com/products/storageworks/msa1000/index.html Though being anywhere around $20,000 they're not cheep ;)
-
Using AdWords with Google could work. Local papers would be good too, now if only I could get more work myself. I would love to get more into web design than I am now, I really do enjoy it.
-
That comment about Geocities and MySpace sounds familar. I miss Geocities it was cool back in the day when I needed a free webhost to tinker around with. I dont have a MySpace account, no reason too either. I have my own webservers and my own web development knowledge. What I hate is when people think something on the web is the internet. Bob: OH yea, I'm using the internet, come see my page at blahblahlbah BobbySue: I can't get the internet to work, the Big Blue 'E' isnt doing anything when I click on it How I miss the days of IRC (when EfNet was the only one around), Archie, Veronica, Gopher, and Mosaic was the only graphical web browser. Lynx was my best friend.... When no on knew about Napster and it wasn't corrupted by computer illiterate people etc ;) </rant> Geesh I feel old, but I'm not really not 'old'...