bob_the _builder
Members-
Posts
206 -
Joined
-
Last visited
Everything posted by bob_the _builder
-
Hi, I havnt found much about that function to alter date/time. I have come across: putenv("TZ=Pacific/Auckland"); Which seems to work if added to scripts.
-
Hi, The server I host on is different time zone to me, is there away I can set the GMT on my site so Dates and Times are correct to my time zone? Thanks
-
That was from the manual I have tried a few ways with no success. Brings back no matches: $sql = mysql_query("SELECT id, firstname, lastname, phone, cellphone, email, starttime, finishtime, event FROM calendar WHERE MONTH(starttime) LIKE 'MONTH(".$eventid.")%'"); Must be close, all makes sence. Thanks
-
Hmm Tried a few ways, no success: $eventid=2007-05-21 $sql = mysql_query("SELECT id, firstname, lastname, phone, cellphone, email, MONTH(starttime) -> 2, finishtime, event FROM calendar WHERE starttime LIKE '".$eventid."%' ORDER BY starttime ASC"); Trying to pull all records for the 5th month. Thanks
-
is the following used to grab records for that month? SELECT MONTH('1998-02-03'); -> 2 I could maybe switch the query if isset($_GET['day'])? Altho I havnt managed to get SELECT MONTH('1998-02-03'); -> 2 working in my query. Thanks
-
When a day is selected from the calendar with the following link, I pass the variable ?day <a href=calendar.php?day&add='.$_GET['add'].'&eventid='.$linkdate.'>'.$day.'</a> I was thinking I could maybe alter the variable $eventid if isset($_GET['day']) Thanks
-
Hi, Its stored as "datetime" Im looking more for an if statment I think. if(isset($eventid)){ $eventid = 2007-05-21 }else{ $eventid = selected_month } Not sure really, trying to keep it simple. Just not sure how to grab all records = to 5th month or 6th month. The variable passed is "2007-05-21" maybe use explode and the date parts? Thanks
-
Hi, I have a query that shows all appointments of a chosen day using the following format: $eventid=2007-05-21 WHERE starttime LIKE '".$eventid."%' I have a calendar and am trying to make it show all records for the selected month, or display all records from a specific day if a day is selected from the calendar. So far I have it where I can show records from specific day, but want selected months records as default. Thanks
-
Hi, Something like: echo 'Ops, you will be redirected shortly.'; header('Refresh: 2; url='.$_SERVER["HTTP_REFERER"].''); You may want to use meta refresh instead. hth
-
Hi, I use something like: $BBCode = array( "<center>" => " [center]", "</center>" => "[/center] ", "<b>" => "[b]", "</b>" => "[/b]", "<u>" => "[u]", "</u>" => "[/u]", "<i>" => "[i]", "</i>" => "[/i]", "<img src=" => "[img=http://'", "'>" => "]", "<li>" => "[list][*]", "</li>" => "[/list]", "<font color='red'>" => "[color=red]", "</font>" => "[/color]", ); $value = str_replace(array_keys($BBCode), array_values($BBCode), $value); $value = mysql_real_escape_string(strip_tags(trim($value))); return $value; } Then reverse it for use with editing. hth
-
Ahh, Perfect thanks!
-
thats no explained well I grab all the records from a field: $sql = mysql_query('SELECT mobile FROM list'); while ($row = mysql_fetch_array($sql)) { $mobile = $row['mobile']; } I want to get all the numbers from the mobile column into a variable like: $mobile = '3245678,87978956,2321332,656546546,etc'; How can I go about that? Thanks
-
Hi, Im trying to grab a column of phone numbers from mysql table, send all the records across a hidden form field along with a message text area and reply field. once submitted grab all the records from the phone number column and format it to: $mobile = '12345,456788,566788,etc'; also grab the message post and reply post data Basically so I can send a the same message to all the mobiles. How could one acheive that? Thanks
-
Hi, I tested both urls and both seemed to be working fine?
-
Inserting an array of photos into database
bob_the _builder replied to bob_the _builder's topic in PHP Coding Help
Im guessin I can use explode function, but im not sure what the delimiter would be with such an array.. Thanks -
Hi, I have a form layed out like so to upload photos and input the file name into the database. while($counter <= $nof){ echo '<div class="editpage"> <label>Photo '.($counter+1).' Title</label> <input type="text" name="photo1alt[]" value="'.$myrow["photo1alt"].'" size="50" /><p /> <label>Change Photo '.($counter+1).'</label> <input type="file" name="photo_filename[]" size="37" /> </div><p />'; $counter++; } Im not to sure how to break that up to insert into the database like so .. $sql = mysql_query("UPDATE mypage SET photo1alt = '$photo1alt', photo1 = '$photo1', photo2alt = '$photo2alt', photo2 = '$photo2', photo3alt = '$photo3alt', photo3 = '$photo3', photo4alt = '$photo4alt', photo4 = '$photo4', photo5alt = '$photo5alt', photo5 = '$photo5' WHERE userid='$userid'"); ? Thanks
-
Hi, I normally send my clients to paypal, but I see alot of sites where you dont leave their site through out the transaction. Also seems faster and more than likely keep the users on yer site. I have converted my cart to sessions. Basically im after a transaction where they can stay on my site throughout it, and so the client doesnt have to join or login to a third party murchant. Thanks
-
*bump*
-
Hi, Is there away to do the following which has errors: <input name="email" type="text" value="'.$email2.'" size="30" /> '. if (empty($email)) { '*' } .' rather than having to break out of the echo through out my table like so: echo '<input name="email" type="text" value="'.$email.'" size="30" />'; if (empty($_POST['email2'])) { echo '*'; } Thanks
-
Hi, Maybe im not explaing my question well enough.. I am covered for sql injection ValidateInput($value); The following code: foreach($_POST as $key=>$value){ $_POST[$key] = ValidateInput($value); } cleans my post data then I use the variable as $_POST['name'] this code: foreach($_POST as $key=>$value){ $$key = ValidateInput($value); } *note: $$key cleans my post data then I can simply use the variable $name This creates less typing and also shorter code. Is this acceptable/safe way to code? Thanks
-
Hi, Validate fields, mostly email addresses, then also maybe incorperate captcha
-
Hi, I previously made a cart using cookies, and have now converted it to using sessions. Is sessions the better way to go? I would also like to add a CC transaction facility to it i guess using SSL Can anyone help to point me in the right direction? Thanks
-
Hi, If you are using a form to upload the MP3 I would store the filename + other data in mysql database, this will be the better all round option. Easyer and also searches etc can be implimented easily. Good Luck
-
Because its tidyer code and less to type. Saves you converting $_POST['name'] to $name = $_POST['name'] So when you use INSERT etc post data goes straight in as $name less code and much tidyer.
-
Hi, Is the following code pluasable to use and safe? foreach($_POST as $key=>$value){ $$key = ValidateInput($value); } Basically then u can use the variable $name rather than $_POST['name'] ? Thanks