c_shelswell
-
Posts
275 -
Joined
-
Last visited
Never
Posts posted by c_shelswell
-
-
Question's in the title really. I've got a site that's a clone of another one but this user wants me to remove the header. It appears over quite a few pages so the easiest way for me to sort it is just to add display: none to the css for the header. The thing is does this still use bandwidth? There's an image in header which is added in the html this is now hidden. Is it still getting loaded though? I guess i could just delete the image off the server so it can't load.
Your advice would be great.
-
For anyone else that comes across this problem. It was a case of setting all collation in the database (the DB itself, tables and fields) to utf-8 then setting the web page to utf-8 and also adding this after connection to the database:
mysql_query("SET NAMES 'utf8';");
cheers
-
Hi I'm really struggling to get characters to display properly. I'm trying to make a site that can show multiple languages where a user has a test input i'm storing it in the DB using htmlentities then where it displays html_entity_decode. This seems to be working fine.
There's also parts where the data is just input to the DB using phpMyAdmin. If i have an e with an accent it won't display unless I use htmlentities. My charset is currently UTF-8 which displays the above fine but if i change it to allow the e accents to display it ruins the above.
Surely I don't have to add htmlentities to each place where strange characters might appear?
If you have any help I'm be really grateful. I'm running rapidly out of hair to pull out!
Oh the test string i'm using is: "test"///\\\'''deü©ΣДçگẫ_cur£$
Cheers
-
i've just been doing this. Use utf-8 character encoding in your metatags. Then when you add something to the database use
htmlentities('your funny text');
then when you want to display it:
html_entity_decode($var);
I had to do it that way anyway as the pages i'm using have a variety of strange and funny characters.
Hope that helps.
-
got it sorted! for anyone else who comes across this problem the solution is actually pretty simple:
echo htmlspecialchars(html_entity_decode($title));
-
Hi I'm trying to add languages to my site. In an area to edit a news item i've got a text box that is pre populated. Problem is that quotation marks in it are stopping it displaying properly. I've got the information stored in the database as htmlentities as:
[pro]kit"test"///\\\'''deü©ΣДçگẫ_cur£$
which should display
kit"test"///\\\'''deü©ΣДçگẫ_cur£$
i'm having to use html_entity_decode to display it properly but when you do that the quotations close the text box early such as:
<input type='text' name='EN_title' class='myInputReg' value="[pro]kit"test"///\\\'''deü©ΣДçگẫ_cur£$" />
anyone have any ideas how to solve this? Cheers
-
cheers wayne,
Though as soon as I add the encoding in i get: cannot yet handle MBCS in html_entity_decode()
The server i'm on is PHP4 which from what i'm reading is a problem?
Cheers
-
ok - my bad seems I should have done some research. I need to add in html_entity_decode.
Though why it doesn't just add it correctly? Or am i missing something?
-
Hi I'm struggling a bit with htmlentities. I've got a text input and a user that wants to add greek symbols such as 'Σ'. After input I add it to the database as
htmlentities('Σ');
But what i'm getting in the database is: Σ when it should be
Σ
any ideas anyone?
-
sorry stupid question. Just do this:
foreach ($_GET as $k => $v) { $link .= "&".$k."=".$v; }
-
Ok another question. If i change the form to $_GET is there an easy way to add that data back to a link like a back button? as the below isn't going to work.
<?php <a href='<?php echo $_SERVER['PHP_SELF']; ?>?data=<?php print_r ($_GET); ?>'>Back</a> ?>
-
that's a good idea. Never thought of that. Cheers
-
Hi,
I've got a form on a page which searches and displays a load of records. A user can then view a record which navigates them away from that page. Is there a way to keep the post data from the previous page so i can add a back button? I thought of storing it all in session vars but this sounds like it could be a bit of a pain in the ar$e.
Does anyone know of any better ideas?
Cheers
-
Fair point. Think it would have been better if i'd thought this through at the start Oh well lesson learnt.
Cheers
-
yeah thing is there shouldn't be a reason to ever add more accounts to it. Is literally just the vat that I want to allow them to edit.
Cheers
-
Hi I've got a constants page that holds the vat percentage plus a number of other things. I'd like to allow a user to edit VAT but nothing else. Is there a good way to do this in php? Or am i really better to create a single mysql table to hold that one bit of data?
Cheers
-
Cheers Daniel0 I'll give that a stab and see if I can get it to work. I've put in my table structures too. Thanks!
CREATE TABLE IF NOT EXISTS `cart` ( `crt_id` int(11) NOT NULL auto_increment, `crt_order_id` int(11) default NULL, `crt_user_id` int(11) default NULL, `crt_customer_type` varchar(55) default NULL, `crt_discount_amount` double default '0', `crt_discount_rate` double default '0', `crt_affiliate_commission` double default '0', `crt_net_price` double default NULL, `crt_price_ex_ipt` double default NULL, `crt_vehicle_type` varchar(255) default NULL, `crt_make` varchar(255) default NULL, `crt_model` varchar(255) default NULL, `crt_registration_number` varchar(55) default NULL, `crt_registered_date` datetime default NULL, `crt_engine_capacity` varchar(55) default NULL, `crt_fuel_type` varchar(55) default NULL, `crt_drive_type` varchar(55) default NULL, `crt_transmission` varchar(255) default NULL, `crt_previous_keepers` int(11) default NULL, `crt_import_marker` varchar(55) default NULL, `crt_age` varchar(255) default NULL, `crt_mileage` int(255) default NULL, `crt_warranty_type` varchar(255) default NULL, `crt_warranty_period` int(11) default NULL, `crt_cover_limit` int(11) default NULL, `crt_base_price` float default NULL, `crt_ipt_tax` double default '0', `crt_warranty_number` varchar(20) default NULL, `crt_warranty_start_date` datetime default NULL, `crt_warranty_end_date` datetime default NULL, `crt_status` varchar(50) default NULL, `crt_renewal_status` int(11) default '0', `crt_garage_name` varchar(255) default NULL, `crt_garage_address` varchar(255) default NULL, `crt_garage_postcode` varchar(55) default NULL, `crt_garage_phone` varchar(55) default NULL, `crt_garage_email` varchar(255) default NULL, `crt_owner_title` varchar(4) NOT NULL, `crt_owner_initial` varchar(255) default NULL, `crt_owner_surname` varchar(255) NOT NULL, `crt_owner_address` varchar(255) default NULL, `crt_owner_post_code` varchar(255) default NULL, `crt_owner_delivery_address` varchar(255) default NULL, `crt_payment_date` datetime default NULL, `crt_commision_status` varchar(50) default NULL, `crt_payment_type` varchar(50) default NULL, `crt_owner_phone` varchar(55) default NULL, `crt_owner_email` varchar(55) default NULL, `crt_update_date` datetime default NULL, `crt_insert_date` datetime default NULL, `crt_voucher` varchar(10) default NULL, `crt_vehicle_price` int(11) default '0', `crt_book_sent` datetime default NULL, `crt_voucher_rate` double default '0', `crt_payment_requested` int(11) default NULL, `crt_profit_price` double default '0', `crt_vin_number` varchar(55) default NULL, `crt_manufactured_date` datetime default NULL, `crt_email_sent` datetime default NULL, `crt_sms_sent` datetime default NULL, `crt_quote_number` varchar(255) default NULL, `crt_telesales_email_content` text, `crt_allocated_id` int(55) default '0', `crt_administrative_fee` float default '0', `crt_vat_amount` float default '0', `crt_last_action_date` datetime default NULL, `crt_mail_status` int(4) default '0', `crt_fund_top_up` float default '0', `crt_modified_date` datetime default NULL, `crt_representative_email` varchar(255) default NULL, `crt_mode_of_sale` varchar(255) default NULL, PRIMARY KEY (`crt_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
and users:
CREATE TABLE IF NOT EXISTS `users` ( `users_id` int(11) NOT NULL auto_increment, `users_refered_by` int(11) default '0', `users_username` varchar(50) default NULL, `users_password` varchar(50) default NULL, `users_admin_password` varchar(50) default NULL, `users_customer_type` varchar(50) default NULL, `users_business_name` varchar(50) default NULL, `users_business_type` varchar(50) default NULL, `users_website` varchar(255) default NULL, `users_title` varchar(4) NOT NULL, `users_contact_name` varchar(100) default NULL, `users_address_1` varchar(100) default NULL, `users_address_2` varchar(100) default NULL, `users_town` varchar(100) default NULL, `users_county` varchar(100) default NULL, `users_postcode` varchar(12) default NULL, `users_email` varchar(100) default NULL, `users_phone` varchar(20) default NULL, `users_fax` varchar(20) default NULL, `users_mobile_number` varchar(20) default NULL, `users_status` varchar(20) default NULL, `users_unique_id` varchar(50) default NULL, `users_commision_payed_to` varchar(20) default NULL, `users_cheque_name` varchar(100) default NULL, `users_paypal_account` varchar(255) default NULL, `users_discount_percentage` double default NULL, `users_affiliate_commission` double default '0', `users_registered_date` datetime default NULL, `users_capture_details` int(11) default NULL, `users_cookie_length` varchar(11) default NULL, `users_affiliateplus_details` varchar(55) default NULL, `users_affiliateplus_units` double default NULL, `users_affiliateplus_percentage` double default NULL, `users_contract_start_date` datetime default NULL, `users_superaffiliate` varchar(11) default NULL, `users_cover_limit` int(11) default '0', `users_cover_period` int(11) default NULL, `users_administrative_fee` float default '0', `users_fund_amount` float default '0', `users_fund_mail_status` int(4) default '0', `users_representative_email` varchar(255) default NULL, `users_delete_status` int(4) default '0', `users_userlevel` tinyint(1) NOT NULL, `users_admin_userlevel` tinyint(1) NOT NULL, PRIMARY KEY (`users_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=344 ;
-
certainly can.
This is the sql:
SELECT * FROM cart left join users on cart.crt_user_id=users.users_id WHERE crt_insert_date between '2009-05-01 00:00:00' and '2009-05-02 00:00:00'
I've just been using a foreach on the returned data going through a line at a time. Which is my problem as I need all the lines but i need certain data grouped such as the username and the total line per user. Here's my php anyway:
<?php if ($rtn) { foreach($rtn as $k => $v) { ?> <tr> <td class='tableLine'><?php echo $v->crt_garage_name; ?></td> <td class='tableLine'><?php echo $v->users_username; ?></td> <td class='tableLine'><?php if ($v->crt_insert_date != NULL) { echo date('d-m-Y', strtotime($v->crt_insert_date )); } ?></td> <td class='tableLine'><?php echo $v->crt_id; ?></td> <td class='tableLine'><?php $grandTotalFund += $v->crt_fund_top_up; echo number_format($v->crt_fund_top_up,2); ?></td> <td class='tableLine'><?php $grandTotalAdmin += $v->crt_administrative_fee; echo number_format($v->crt_administrative_fee,2); ?></td> <td class='tableLine'><?php $grandTotalVat += $v->crt_vat_amount * $rtn[0]->crt_administrative_fee; echo number_format($v->crt_vat_amount * $rtn[0]->crt_administrative_fee,2); ?></td> <td class='tableLine'><?php $grandTotalInv += $v->crt_net_price; echo number_format($v->crt_net_price,2); ?></td> <td class='tableLine'><a href='./fund_day_book_view.php?crt_id=<?php echo $v->crt_id; ?>'>view</a></td> </tr> <?php } ?>
cheers
-
I've been scratching my head on this for a while and i'm hoping its a can't see the wood for the trees question!
I've got an array which for example contains 3 purchase entries for username 'fred' and then 2 entries for 'brian' I need to display a total line after each user and also only display their username once. I can't group the mysql output as that'll only give me one line.
Has anyone come across this before and have any advice?
Cheers
-
I was struggling with tables in fpdf I got borders sorted. I think I need to copy an invoice that i already have. So the clients pages are all the same.
-
I actually just found this http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_installation which seems to work without any extra extensions
Not perfect at html but it should do what i need i think.
Cheers
-
Hi,
Does anyone know of a decent script to convert HTML to PDF on the fly. I'd be great if it would work on a windows and linux box for the sake of testing. I've tried FPDF but it doesn't really get on well with css also dompdf but can't seem to get it to work at all. Perhaps i'm doing something wrong.
If anyone has any suggestions that'd be great. I basically just need to create a tabular invoice for a user to download.
Many thanks
-
Nice one thanks the php method didn't work out but the database alias worked a treat.
Thanks very much Mchl
-
Hi I've got a database class which is all working great for me however I've just tried to get a MAX figure from mysql and now I can seem to access the returned value my code to get the value is:
<?php $data = array('fields'=>'MAX(crt_order_id)', 'table'=>'cart'); $nextCrt = $db->selectFromDB($data); echo "<pre>"; print_r ($nextCrt); echo "</pre>"; ?>
which prints:
Array ( [0] => stdClass Object ( [MAX(crt_order_id)] => 5522 ) )
normally i'd just been getting what I wanted by $nextCart[0]->crt_order_id but the MAX seems to have messed things up for me. Don't suppose anyone can help?
Cheers
Does display: none still use bandwidth?
in CSS Help
Posted
cool will maybe give that a shot. Didn't know if it was something someone had tried already.
Cheers