-
Posts
289 -
Joined
-
Last visited
Everything posted by JKG
-
oh i see. are they in the same table? edit: even if they are, i dont think you can. not because of php but because of the way jquery uses sortable lists. i might be wrong, im not great with js and so i cant help you. sorry.
-
"move between several lists" i dont understand sorry. do you mean you would like multiple instances?
-
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
i trimmed the values before and now it works fine. the function is just to display the various fields, but some are optional, and i didnt want to but a line break and comma there for users who have not entered their details. it was a simple idea but just took me longer due to my lack of proper debugging. so thank you PFMaBiSmAd and TeNDoLLA. ord returned 32 - it has a space character in it... to my mind this is solved now, thanks for all your help. -
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
that sounds more efficient, however i get this error: Fatal error: Can't use function return value in write context in /home/theweddi/public_html/scripts/functions.php on line 270 even when im not calling the function. any ideas? -
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
thank you for your help with this. i have now updated my function to: function tws_empty($var, $type){ if(!empty($var) && ($var != '') && ($var != ' ')){ //type 1: profile page address if($type == 1){ echo $var . ', <br />'; } } } i thought empty() took whitespace into account... ord() displays nothing... with or without the space... -
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
i think its empty because i put nothing in it. and phpMyAdmin shows nothing in it. string(1) " " is what is returned... -
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
thanks for your continued help. unfortunately that to does not work. php does not recognise this variable as empty, even though it is. :s any other ideas? -
field from database table row is empty but php doesnt recognise it
JKG replied to JKG's topic in PHP Coding Help
already tried that, doesnt work. i suppose it is set... any other thoughts? i just thought i was being thick! -
anyone know why this wouldn't work? function tws_empty($var, $type){ if(!empty($var) and ($var != '')){ //type 1: profile page address if($type == 1){ echo $var . ', <br />'; } } } the field from the row is definitely empty, but i cant get it to show as empty... even a simply line like: if(empty($displayUser['address_2'])){echo 'asdf';}; just isnt echoing... any thoughts? i know its something really simple!! thanks. Joe.
-
i would not recommend osCommerce at all.
-
when you go to the directory containing the images, it probably shows a list of all the files in that directory. in your upload script, just add a line to create file in that dir called index.html this means you dont have to change any server settings but google wont be able to grab your images (provided they are referenced to in a user area only) through a directory listing... as to the files currently found by google, your only hope is to change file names or locations...
-
make your .htaccess file in your root dir copy this into it redirect 301 http://www.site.com/old.htm https://www.site.com/new.htm redirect 301 http://site.com/old.htm https://www.site.com/new.htm then repeat those lines for each page. maybe you only need to do your login page, maybe you will have to quite a few pages. depends on your login setup
-
yeah, just get your old login urls, and redirect them to the new https ones. once they are through to the https area, the relative urls should keep them in there. http://www.htaccessredirect.net/ or just google it, its nice and simple.
-
i started on fireworks mx. now i use photoshop for pretty much everything, i used to just use FW for exporting images, then i realised PS has great 'Save for web and devices' option, which reduces file sizes to a bear minimum. i prefer the way PS uses layers, i think thats pretty much it: preference. they both can do most jobs.
-
hi, i have built a site with a user login section. basically, im wondering how to go about charging users to use it. i only need to stop their results appearing on one page. does anyone know anything about paypal subscriptions (or an alternative) and how i can best use build it into a site. we are looking at £1-2 per month subscriptions. if the subscription goes through, show their result, if it doesnt, dont... with a call back page i could set it for the first transaction, but how would i check they have paid it every month? i am fluent with php, just starting to think about this idea and how i can go about it. your feed back would be appreciated. thanks
-
yes definitely. i learned to touch type at 12 years old. i use coda.
-
fair enough. i didnt realise zues was so rare, i never had heard of it either, but i just thought that was my inexperience. namesco hosting uses zues, which is a pretty big name. anyway, thanks
-
if any one was wondering (i doubt they were as this section of the forum is DEAD!) then i got it to work using this: match URL into $ with ^\/new/ses\-holdings\-([^/]*)\.html$ if matched then set URL = /new/index.php?page=$1 endif thanks. Joe.
-
i have now got this far: match URL into $ with ^(\/new)/ses\-holdings\-[^/]*\.html$ if matched then set URL = /new/index.php?page=$1 it works in that it doesnt error. but the $1 at the end of the second line isnt correct. how do i carry accross the variable to insert it to page=foo thanks for your help
-
hi there. thanks for taking the time to read this post. i was wondering if someone could help me convert this really simple mod_rewrite into zeus. RewriteEngine On RewriteRule ^ses-holdings-([^/]*)\.html$ /new/index.php?page=$1 [L] this is what i have come up with: match URL into $ with ^ses-holdings-([^/]*)\.html$ if matched then set URL = index.php any help appreciated. thanks.
-
did this. so no js in db!! thanks thorpe... <?php function make_js($date_raw){ if(isset($date_raw)){ $datesarray = explode(";", $date_raw); $i = 1; foreach($datesarray as $val){ $date = $val . ''; $iplus = $i++; $jsdate=date("Y,G,j", mktime(substr($date, 5,2)-1,1,0, substr($date, 5, 2), substr($date, -2), substr($date, 0, 4))); echo 'var date'.$iplus.' = new Date('. $jsdate . ') date'.$iplus.'.canSelect = "true"; date'.$iplus.'.selected = "false"; date'.$iplus.'.type = "normal"; '; } echo 'var myArray = new Array('; $i2 = 1; while($i2<=$iplus){ echo "date".$i2++; if($i2 <= $iplus){ echo ','; } } echo '); ms_cal.addDates(myArray);'; } } if(isset($_POST['d'])){ $data = array($_POST['d']); foreach($data as $d){ $dates_php = ""; foreach($d as $v){ $dates_php .= $v.";"; }} mysql_query("UPDATE `users` SET `unavailable_dates_array` = '{$dates_php}' WHERE `Id` = '".$_SESSION['user_id']."'") or die("SQL Error: " . mysql_error()); echo $dates_php; } ?> <script type="text/javascript"> /*<![CDATA[*/ var ms_cal; window.onload = function () { ms_cal = new Epoch('epoch_multi','flat',document.getElementById('multi_container'),true); <?php if(unavailable_dates_array ( $_SESSION['user_id'] ) != ''){make_js(unavailable_dates_array( $_SESSION['user_id'] ));}; ?> }; /*]]>*/ </script>
-
i kind of figured that now too: $data = array($_POST['d']); foreach($data as $d){ $dates_php = ""; foreach($d as $v){ $dates_php .= $v."; "; }} last question i promise!! how can i grab all the dates (look something like this: 2011-07-06; 2011-07-13; 2011-07-20; 2011-07-21; 2011-07-28;) and turn it into an array of dates? i presume i would use str_replace, or explode() or something, can i just have a pointer please?? thanks so much.
-
ok, so i found out how to do... kind of! foreach($data as $d){ foreach($d as $v){ $dates_php .= $v."; "; }} however, this throws up this notice, do you know why? Notice: Undefined variable: dates_php in /root/path/unavailable-dates.php on line 35 thanks for you help!!
-
yeah im starting to see what you mean... just pull the dates and pass them through the loop on the fly... how would i make function make_dates($data_array) into a string as there is only one return anyway? its only storing the first date...
-
the php builds javascript that tells a calendar which dates are available or not. everytime a user adds another date, or takes one away it updates the javascript which adds or takes away an added date. using the http://jkgo.co.uk/epoch calendar. will have a go at the string in a sec.