SharkBait
Members-
Posts
845 -
Joined
-
Last visited
Never
Everything posted by SharkBait
-
Am I doing this wrong?? [code] <div style="margin-left: 250px; width: 100px; padding: 5px;"> <input type="hidden" name="uid" value="<?php echo $uid;?>" /> <input type="image" src="images/submit.gif" value="Submit" name="submit" title="Submit"/> <!-- <input type="submit" value="Submit" name="submit" /> --> </div> [/code] In Firefox it works fine. The script is executed with no issues. In IE, it just refreshes itself. I have a [code] <?php if(isset($_POST['submit'])) { echo "I WAS SUBMITTED"; } ?> [/code] Firefox shows the I WAS SUBMITED but IE does not. I commented the <input type="image" out and used the regular <input type="submit" and it works. but I'd rather use the graphic as the button than CSS the form's button.
-
Hi, I don't think it is possible, but PHP's Mail() function does not suppose the sending of attachments correct? I'm just looking at ways of automating some of my database backups and without using rSync (haven't gotten around to it), and though about if I have the database dump the databases I need to a particular folder on the server (which I have currently with cronjobs) I could then script a cronjob to execute a php script to send me the files from the directory. I also would like to do this if its possible because a couple of people need a table dumped out every monday and emailed to them. Currently I just dump in a CSV format and email them the file. Just looking to be more efficient.
-
So you mean make it like 400% the size it should be, and then just resize. I'll have to try that..
-
It would be nice to be able to run Safari on the PC. Only issue I have with a website I work on is that people say in Safari (1 or 2 people anyway) have said my menus don't work. Their javascript/css based. They work on all other browsers with no issues. The rest of the site works.. just the drop down menus done. *shrug*
-
Hi, I am trying to make better shapes for the web using photoshop and I am having issues creating images with curves that don't look so pixelated for the web. I dont have an example at the moment, but if someone could a) point me to a good tutorial to making un-pixelated curves in PS that be good (yea I know there a billions of PS tuts out there) b) Perhaps guide me via the forum here how I would go about it. I currently use PS CS1 and been using a mix between the shape tools and the pen tool to manipulate the vertexes. This is the image actually that is pixelated and I want to make smooth. [img]http://tingram.ca/pixelate.jpg[/img]
-
If you're using IE Beta 7 and/or Firefox. The sessions will stay within the tabs. Opening a new tab wont allow for a new session to be created. But if you are using difference instances of the browser, they're supposed to start new sessions. Its how I test, I have FireFox open with one account on a site, then have IE open the same site but use a different account.
-
Why store them in a session when they are already stored in the $_POST[]? This is how I do it when I make forms and want them to echo the fields that have already been filled in so they don't have to do it again. [code] <?php if(isset($_POST['submit'])) { $errMsg = ""; // String to store error messages to be displayed later... // Form has been submitted use $_POST[] to get the values if(!empty($_POST['cName'])) { // Name was not left blank $name = $_POST['cName']; } else { $errMsg .= "<li>You cannot leave the Name field blank.</li\n"; } if($errMsg == "") { // Do your think there } else { // There was a submission error echo "There have been errors with your submission, they are: <br /> <ul>{$errMsg}</ul>\n"; } } // Display Form and check to see if the $_POST[] variables are already set ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> Name <input type="text" name="cName" value="<?php if(isset($_POST['cName'])) echo $_POST['cName'];?>" /> <input type="submit" value="Submit" name="submit" /> </form> [/code]
-
Pretty much your form field should look like this: [code] Name: <input type="text" size="20" name="cName" value="<?php if (isset($_POST['cName'])) echo $_POST['cName']; ?>" /> Email: <input type="text" size="20" name="cEmail" value="<?php if(isset($_POST['cEmail'])) echo $_POST['cEmail'];?>" /> [/code] If it works in Firefox and not in IE, might be a silly HTML error. Firefox seems to be smart enough to fix them on the fly, and IE isnt... or thats my experience anyway..
-
[quote author=timgetback link=topic=102866.msg408949#msg408949 date=1154620190] thanks... also when i added the header function at the end of my php file.... it kept telling me that i have an error at line 47 which is the line that has "?>" i dont understand why theres an error there. When i moved the header to the top of my php file and added "exit;" right after it it repeated the same error. [/quote] Might be you're missing a ending } somewhere in your code.
-
If your loop is printing out the word 'array' each time. Then the array has an array inside of it. Check with print_f($uniqueTown) or even print_f($townImage) I guess :) Then if it is a multi-dimenision array, then just use nested loops.
-
Depends on what else you want to do.. Just remember that you cannot send any output to the browser prior to the header() and anything after won't be seen because its not on that page anymore. As for it continuing execution of the script after the header() function, I am not sure if it does any of it. I usually have exit() after my header() and then whatever else I need to do will be in the script that you're calling header with.
-
Just seems that the permissions on the script that needs to rename the file is incorrect. Or that the directory where the file is to be renamed does not have the correct permissions either...
-
If the domain name is always the same then you could substr() it or explode it with / being the dilmeter and using the second index... [code] <?php // domain user sample: MyDomainName/SharkBait $domain_user = substr($_SERVER['LOGON_USER'], 0, 13); // Or split it up $domain_user = explode("/", $_SERVER['LOGON_USER']); $domain_user = $domain_user [1]; ?> [/code]
-
I suppose depending on how you name your photos in the folder.. if you were to do them by numbers and only select 1 to 10 (or whatever) in your loop when you go through the folder, and then if they click on a link it will show 11 to 20? Code wise, I'm not sure. I am sure it can be done though but it would be having to control the loop that loads the contents of the folder and only displaying the amount you want. Get the total amount of items in the directory. Then divide that by how many you want per page. Keep a variable of what page the user is on. If you take a peek at the tutorials on the PHP/MySQL pagnation here in PHPFreaks I'm sure it can be modified to work with folders and files instead of a database :)
-
You can use either a meta refresh. Forget the exact HTML for it. Or you can use PHP's header function to move them [code] <?php // You can not have any text sent to the screen prior to using header(); header("Location: http://mynewsite.com"); exit(); ?> [/code]
-
Ya know.. that makes sense! Silly me forgot that I always make the navigation a fixed with. Thanks
-
There is a tutorial on PhpFreaks about tracking users on your website via their session IDs. Though you need to be running MySQL or some sort of database to help keep track. Think it's this one: http://www.phpfreaks.com/tutorials/62/0.php
-
[quote author=BillyBoB link=topic=100657.msg397635#msg397635 date=1152958637] is there an site that i can goto where i can get info on how to block ips in php script the blocked ips will be in a database plz tell me thanks [/quote] Perhaps the best queston would be, why do you want to ban them? In regards to the post that talks about how an ISP might change their clients IPs regularly, then you should ask yourself. What are these people doing that makes you want to ban them? If they are users on your website. You could block their login username. If they try to sign up again, you can check to see if they are trying to use the same email address. Sure people can create multiple email addresses, but then you could just limit the email addresses of your users to that of their ISP (yes I know some ISPs can allow up to 10 emails or even more). Just some thoughts. Personally I'd ban the IP. Another thing I have thought about is banning the ISP. You do a reverse lookup to see what domain they are from and ban that. If there are multiple users from the ISP, then you could do a ignore type thing to ignore those who are good. Then after a while if the trouble seems to calm down you could lift the ISP ban. This is what we've done on MUDs that I've helped maintain etc. Though its a bit of a pain if alot of users are from a particular banned ISP.
-
Alright.... I am having troubles with this bit of code: [code] <div style="width: 180px; padding-left: 5px;"> <div style="float:left; background-image: url('images/menu-title-left.gif'); background-repeat: no-repeat; width: 14px; height: 25px;"> </div> <div style="float:right; background-image: url('images/menu-title-right.gif'); background-repeat: no-repeat; width: 14px; height: 25px;"> </div> <div style="background-image: url('images/menu-title-repeat.gif'); background-repeat: repeat-x; margin:0; padding: 0; padding-top: 8px; font-weight: bold; font-size: 11pt; color: #fff; height: 17px;"> Main Menu </div> <div style="clear:both; border: 1px solid #999; background-color: #ddd;"> <ul class="leftmenu"> <li><a href="">Home</a></li> <li><a href="">About</a></li> <li><a href="">Guestbook</a></li> </ul> </div> </div> [/code] It works fine in Firefox. But IE6 makes the middle section of the title bar not match up with the left and right float. Sample: www.tingram.ca Check it in IE6 and then look at it in FireFox (firefox is how I want it to look). When I used IE7b2 it looked fine, but IE6 killed it. How can I fix this? I hate how IE6 butchers div tags. Though its nice IE7 works a bit better in regards to w3 consortium's standards etc. Not sure if I am following them but hey.... :) Thanks
-
One thing I have had to do was have hotmail accept the domain it was coming from. But of course you cannot tell all your users to do that. I also think its only available in their Hotmail Live version. What I am doing is relaying through our company mail system. Webserver -> MailServer -> Outside world. Our mail server might be rewriting the header so Hotmail might see it as being a spoofed address. *shrug*
-
The last one does what I want it to. Thanks :) Lets see if I can explain this to myself. [0-9a-fA-f]{2} Matches 2 characters in a hex type manor (?=([:;.]))) Matches the delimeter inbetween the 2 digit groupings (?:\\1[0-9a-fA-F]{2}){5} I assume this checks that there are upto 6 two character groupings? I guess the last little bit I am a bit foggy on. But it does work which is cool!
-
Hi, I'm trying to figure out my regex for validating a MAC address. I obviously have it wrong but this is what I have: [code] <?php $mac = "00:00:00:00:00:00"; if(preg_match('/^[A-F0-9.:;]{2}+\.[A-F0-9.:;]{2}+\.[A-F0-9.:;]{2}+\.[A-F0-9.:;]{2}+\.[A-F0-9.:;]{2}\.[A-F0-9.:;]{2}$/i', $mac)) { echo "MAC is valid"; } else { echo "MAC IS INVALID"; } ?> [/code] I want to match: 00:00:00:00:00:00 00;00;00;00;00;00 00.00.00.00.00.00 0000000000 Where 00 must be within A-Z 0-9 case insensitive. What am I doing wrong?
-
When I upload a file I tend to do rename it with the move_uploaded_file() function. [code] <?php if(move_uploaded_file($_FILES['file']['tmp_name'], $updir . $newFilename)) { // file was moved and renamed } else { // There was an error moving the file } ?> [/code]
-
wildteen88 - Thanks that works nicely and I see how it has to loop through. I need to brush up on my regex ;) Daniel0 - I saw that PEAR module a while back, but thought I would see how it is done without PEAR. Thanks though. I did a reverse of the doTyCode() so that when a user replies to the message, it converts the <div></div> back into [quote][/quote] :)
-
This is what I am getting with the following: [code=php:0] function doTyCode($str) { $code = array("#\[quote\](.*?)\[/quote\]#is", ); $html = array("<div class=\"quote\">\\1</div>", ); $str = preg_replace($code, $html, $str); return $str; } [/code] [img]http://64.251.82.21/~tingram/quote.gif[/img]