sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
If I can get some free time in the next few days, I could look at the script, but I can't promise anything. I think you oughta go back to those other forums and start being annoying!
-
Have you read the docs and asked this in their forum? I'd be reluctant to use a script that doesn't have support from the author/community. It does look nice though...
-
checkbox - how to select and siplay info from db
sKunKbad replied to avraamG13's topic in PHP Coding Help
http://w3schools.com/php/php_post.asp Sorry it took so long to respond. Here is a good explanation of what you need to know to make what you are doing happen. http://w3schools.com/php/php_post.asp -
checkbox - how to select and siplay info from db
sKunKbad replied to avraamG13's topic in PHP Coding Help
You need a form action and method, then you use the data that is sent by the form. If you choose to post, your form data will be available via the $_POST array. You can then use this form data as desired. -
[SOLVED] Inserting into database using an array
sKunKbad replied to forumnz's topic in PHP Coding Help
You would have to loop through your arrays, and create a database query while doing this looping. -
If it were possible, then you should view the paypal API docs on paypal's site, because that is where you would find your solution.
-
I dont think this is possible. When a payment is made to paypal, paypal has to be able to let the recipient of the money refund the payment, and if it is split, the recipient does not have that ability. It also probably violates paypal's TOS, so you might check with them.
-
I would serialize the data in array form before adding it to the database in 1 field. The serialized data can always be retrieved and unserialized, and this eliminates a lot of extra work.
-
switch($selected_city){ case 'london': echo 'remember to drink some tea'; break; case 'los angeles': echo 'remember to pack your firearm for protection'; break; case 'tokyo': echo 'remember your soy sauce'; break; }
-
Here is the whole doc if it matters # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC] # RewriteRule ^(.*)$ http://www.mysite.com%{REQUEST_URI} [L, R=301] # Protect application and system files from being viewed RewriteRule ^(application|modules|system) - [F,L] # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !^google2d216fed8ww53492f.html [NC] RewriteCond %{REQUEST_FILENAME} !^y_key_8b37d87ae82wwr07b3e.html [NC] RewriteCond %{REQUEST_FILENAME} !^robots.txt [NC] RewriteCond %{REQUEST_FILENAME} !^current-projects.php [NC] # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT,L] redirect 301 /current-projects.php http://www.mysite.com/development.php the non-www to www is commented out because that gives me the error
-
I'm trying out the kohana framework, and it routes or rewrites all traffic through index.php. This however isn't seen in the browsers address bar. I need to set up my .htaccess to convert non-www urls to www. This was easy in the past, but this framework has mixed things up a bit. Right now, I've got all pages except for the home page doing what it is supposed to. I'm just not sure how to tell apache to rewrite the url for the home page. This is what I have: RewriteRule .* index.php/$0 [PT,L] RewriteCond %{HTTP_HOST} !^www\.mywebsite\.com [NC] RewriteRule ^(index.php)?/(.*) http://www.mywebsite.com/$2 [R=301] So, any page other than the home page is converted to www.
-
Simple validation script works in all browsers I tested except IE6
sKunKbad replied to sKunKbad's topic in Javascript Help
The problem was with my installation of multiple IEs after installing IE8. I haven't tried to reinstall multiple IEs yet, but will try tonight when I get home. If multiple IEs' IE6 doesn't work after reinstalling, it could mean the end of IE6 support for me. I don't know what other developers do, but it isn't in my budget to have another computer at home, just to run IE6. Yes, I could run a virtual installation of XP on my ubuntu, and it would have IE6, but my computer is dual boot, and it would suck to have to reboot anytime I want to see something in IE6. The browsers in Firefox never seem to have issues, so I don't go to that side when I'm working. -
Simple validation script works in all browsers I tested except IE6
sKunKbad replied to sKunKbad's topic in Javascript Help
Have you tried to load the page in my original post in IE6? I have regular IE6 at work on a Win2K machine, but at home I only have multiple IEs. -
Simple validation script works in all browsers I tested except IE6
sKunKbad replied to sKunKbad's topic in Javascript Help
Didn't work for me. I wonder if it has anything to do with the fact that I am using multiple IEs version of IE6. -
Honestly, javascript is not my strength, so I'm hoping somebody will point out what is wrong very easily. When I go to my contact form in IE6, I can not type in the fields. My form has an onkeyup event in the form's open tag. The script that checks 3 form fields is this: function validate(){ var realname=document.getElementById("rn").value var email=document.getElementById("addy").value var mesg=document.getElementById("mesg").value var nameIsGood = 'no' var emailIsGood = 'no' var myNameRegex = /^[a-z\s'-]*$/i; var matchPos1 = realname.search(myNameRegex); if (realname != ''){ if (matchPos1 != -1) { document.getElementById("name-status").style.color = '#66cc66' nameIsGood = 'yes' }else{ document.getElementById("name-status").style.color = '#ff0000' nameIsGood = 'no' } }else{ document.getElementById("name-status").style.color = '#ff0000' nameIsGood = 'no' } var myEmailRegex = /^(?:^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|gov|mobi|tv|biz|info|jobs|museum|edu)$)$/i; var matchPos2 = email.search(myEmailRegex); if (email != ''){ if (matchPos2 != -1) { document.getElementById("email-status").style.color = '#66cc66' emailIsGood = 'yes' }else{ document.getElementById("email-status").style.color = '#ff0000' emailIsGood = 'no' } }else{ document.getElementById("email-status").style.color = '#ff0000' emailIsGood = 'no' } var myMesgRegex = /<+|>+/; var matchPos3 = mesg.search(myMesgRegex); if (mesg != ''){ if (matchPos3 == -1 && nameIsGood == 'yes' && emailIsGood == 'yes'){ document.getElementById("button").disabled = '' document.getElementById("notags").innerHTML = '' }else if (matchPos3 != -1){ document.getElementById("button").disabled = 'disabled' document.getElementById("notags").innerHTML = 'Error: No < or > symbols allowed in message body!' }else{ document.getElementById("button").disabled = 'disabled' document.getElementById("notags").innerHTML = 'Either your name or email address is not valid!' } }else{ document.getElementById("button").disabled = 'disabled' document.getElementById("notags").innerHTML = '* All Form Fields Are Required !' } } If you'd like to see what I'm working on in action, go to my website www.brianswebdesign.com, and then go to /test/kohana/contact.php . Sorry, I broke the link in 2 because I don't want to have the link indexed. Thanks for any help.
-
It is way better to use png files for your images that contain transparency, because pngs have an opacity value to the pixels, while gifs are either "on or off". IE6 is the only recent browser to worry about when considering png transparency, but you can overcome this easily with a little javascript called supersleight var supersleight = function() { var root = false; var applyPositioning = true; // Path to a transparent GIF image var shim = 'x.gif'; // RegExp to match above GIF image name var shim_pattern = /x\.gif$/i; var fnLoadPngs = function() { if (root) { root = document.getElementById(root); }else{ root = document; } for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) { // background pngs if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) { bg_fnFixPng(obj); } // image elements if (obj.tagName=='IMG' && obj.src.match(/\.png$/i) !== null){ el_fnFixPng(obj); } // apply position to 'active' elements if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){ obj.style.position = 'relative'; } } }; var bg_fnFixPng = function(obj) { var mode = 'scale'; var bg = obj.currentStyle.backgroundImage; var src = bg.substring(5,bg.length-2); if (obj.currentStyle.backgroundRepeat == 'no-repeat') { mode = 'crop'; } obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')"; obj.style.backgroundImage = 'url('+shim+')'; }; var el_fnFixPng = function(img) { var src = img.src; img.style.width = img.width + "px"; img.style.height = img.height + "px"; img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"; img.src = shim; }; var addLoadEvent = function(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); }; } }; return { init: function() { addLoadEvent(fnLoadPngs); }, limitTo: function(el) { root = el; }, run: function() { fnLoadPngs(); } }; }(); // limit to part of the page ... pass an ID to limitTo: // supersleight.limitTo('header'); supersleight.init(); There is also a special gif image that makes this work, you can copy it from my site using the following link: http://www.brianswebdesign.com/x.gif It's only a 1 pixel gif, and that "page" will look blank, but the image is there.
-
$pref = "abc"; $ie = strpos($order,$pref); IF ($ie == false){ $new = $pref .= $order; }
-
include inside a class, how to use a function in the include
sKunKbad replied to sKunKbad's topic in PHP Coding Help
Yeah, I just needed a couple $this->s and everything is ok -
I've got a class, and inside one of the methods of the class, a procedural type script is included that has a function to check email addresses, and returns true or false if the email address is good. Because the script is included inside a method of a class, I'm wondering how to use the procedural function, because it is not working right now. This is the include and function usage: include 'domainMXval/domainMXval.php'; if (!validateEmail($this->email, true)){ $fail = 1; $errorMessageStack[] = '<li>Your email address</li>'; } I'm just wondering if I need a $this-> somewhere, or what. I've got this working in a procedural script, but now that it is in a class it doesn't work anymore.
-
[SOLVED] Get the key of highest value in an associative array
sKunKbad replied to sKunKbad's topic in PHP Coding Help
Actually, it wasn't solved, but I did solve it. I'm working on a google sitemap generator for the Kohana php framework. You can see in the code below that I am checking the last modified time of all controller and view files associated with a "page", then I compare those times and output the sitemap with the most recent last modified time for each "page". There's still a lot of work to do... header("Content-Type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">"; $pages = array( 'welcome' => array('views/welcome_content.php','controllers/welcome.php'), 'second' => array('views/second_content.php','controllers/second.php') ); foreach ($pages as $page => $parts){ for($x=0;$x<=count($parts)-1;$x++){ $filename = "C:/wamp/www/kohana/application/$parts[$x]"; $timecheck[] = filemtime($filename); } $largest = max($timecheck); $large = array_keys($timecheck, $largest); $filemtimeHome = date ("c", $timecheck["$large[0]"]); echo " <url> <loc>" . url::site("$page", 'http') . ".php</loc> <lastmod>$filemtimeHome</lastmod> </url>"; unset($timecheck); } echo"</urlset>"; -
[SOLVED] Get the key of highest value in an associative array
sKunKbad replied to sKunKbad's topic in PHP Coding Help
I figured it out. I just needed to use arsort() Well, I spoke too soon... -
Hey, thanks! I'm not up to speed on my printf and sprintf. I appreciate your quick answer.