Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
60% Quality Score
Upvotes Received
5
Posts with Upvotes
5
Upvoting Members
4
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
2 Commented Posts

74 Posted Topics

Member Avatar for liamfriel

Hello all, I am working through Beginning Microsoft Visual C# 2008 I was asked to create a console application that multiplies 4 input values. I decided to take all 4 values at once and multiply them. Here is my code: string inputNumbers; string userName; Console.WriteLine("Enter your name:"); userName = Console.ReadLine(); …

Member Avatar for castajiz_2
0
232
Member Avatar for ravi142

Taken from http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html $this->load->helper('form'); $options = array( 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt', ); echo form_multiselect('shirts[]', $options, $shirts_on_sale);

Member Avatar for liamfriel
0
6K
Member Avatar for liamfriel

Hello all, I am pretty new to ASP and we are using ASP for logins for our PHP projects, we are using Active Directory LDAP. We can only connect to one container at a time. I have managed to create some code so switch containers but I cannot log in …

Member Avatar for liamfriel
0
205
Member Avatar for haribo83

but the line spaces as you would in phpMyAdmin [CODE]echo nl2br($row_jobdetails['job_description']);[/CODE]

Member Avatar for nishchal_619
0
4K
Member Avatar for rohit.k2903

With no code examples we cannot possibly begin to help you. Chances are though it is a global server issue. Do you maintain the server yourself or is it hosted?

Member Avatar for veedeoo
0
126
Member Avatar for liamfriel

Hello all, I am trying to use more regex but I can't seem to get this to work. The aim is to check inputs for either [url, [link or <a href: [CODE] $islink = false; foreach($_POST as $k => $v){ if((preg_match("/[url|[link|<a href/i", $v)) > 0 ){ $islink = true; } …

Member Avatar for liamfriel
0
163
Member Avatar for liamfriel

Hello, I am using a script to process subscriptions on our sites - I can sucessfully get the subscription payment to process, I am having issues processing a cancel IPN request. [CODE] // assign posted variables to local variables $item_name = make_safe($_POST['item_name']); $item_number = make_safe($_POST['item_number']); $payment_status = make_safe($_POST['payment_status']); $payment_amount = …

Member Avatar for liamfriel
0
243
Member Avatar for cristi08

Any variables with the values false/0/NULL/"" are considered to execute false in PHP [CODE] #execcute if $cantitate[$i] is not null if($cantitate[$i]){ //this part of the array is not NULL..... } [/CODE] Would also be fine.

Member Avatar for cristi08
0
174
Member Avatar for Mogradjinn

If the user does not need to interact with that particular element why have it. You could try the attribute disabled: [CODE] <input type="text" name="name" disabled="disabled" /> [/CODE]

Member Avatar for Mogradjinn
0
147
Member Avatar for pabzzmike

Hello to get the time use the date() format: [CODE] //get hour in 24 hour format $hour = date("H"); if($hour >= 06 && $hour < 12){ echo "<img src='morningimage.jpg' />"; }elseif($hour >= 12 && $hour < 18){ echo "<img src='afternoonimage.jpg' />"; } [/CODE] Simply repeat for whatever time you want.

Member Avatar for liamfriel
0
119
Member Avatar for liamfriel

Hello, I am using cpanel standard crontab set-up, I have the path to the file correct but the path leads to a password protected directory ie: *php /home/example/public_html/admin/script.php* admin is password protected, how would I allow the crontab access to the script? Thanks in advance.

Member Avatar for chrishea
0
133
Member Avatar for visualmonk
Member Avatar for liamfriel

Hello, Bandwidth on one of our sites was severely messed with on the 28th of this month. The cpanel only tracks daily access logs and didnt archive them(it does now), using aw stats I found our bot traffic to be as follows: Googlebot 145686+43 7.47 GB 28 Jul 2010 - …

0
126
Member Avatar for muralibobby2015

try [CODE]imagepng($bgim_new,$bgth_file_name,100);[/CODE] the last parameter you pass is image quality - having it 9% of the image quality may cause the black to appear!

Member Avatar for muralibobby2015
0
117
Member Avatar for whiteyoh

Might I reccomend you get a javascript error console! I use web dev for firefox - it might display a non standard error which is affecting the IE rendering - failing that maybe a run active objects script?

Member Avatar for liamfriel
0
108
Member Avatar for rukshilag

A class is a group of php code that you can use to create a massive set of data you write it the same way you do php code with a few exceptions. [CODE] class First(){ $this->text = "My First class" } //and you call it like so, $firstclass - …

Member Avatar for jenyroger
0
207
Member Avatar for Roses89

If you want to make sure NO caps wahtsoever are user name and password. [CODE] //detect the presence of caps function hasCaps($string) { return(preg_match('/[A-Z]/', $string) > 0 ? true : false); } //don't know how to use functions in if's so will call the functions then make a comparison $usernameCapFree …

Member Avatar for scaiferw
0
98
Member Avatar for liamfriel

Hello I was helping a fellow daniwebber and I noticed that I have no idea if it is possible and how the syntax works for it. Any help appreciated. example of how I think it works. [CODE] function retTrue(){ return true; } //code in if if(retTrue()){ //do some php } …

Member Avatar for SikoSoft
0
6K
Member Avatar for dandixon

The structure is fine - you just need to run a better query. Lookup how to do Joins or querying multiple tables. [B]example[/B] [CODE] $query = "SELECT `p`.`partnumber`, `p`.`description`, `m`.`manufacturer` FROM `parts` `p`, `manufacturers` `m` WHERE `p`.`manufacturer_id` = `m`.`manufacturer_id`" [/CODE] This will set a condition to get both the parts …

Member Avatar for liamfriel
0
1K
Member Avatar for tiger86

This reminds me of the southpark "You have 0 friends" episode. I deleted my bebo social network because it was crummy, but I enjoy the control you DO have over facebook and the standard profile that keeps things neat, I dislike the apps that cause other people to post on …

Member Avatar for liamfriel
0
176
Member Avatar for MDanz

The other solution would be to calculate the value using the auto incremented value i.e if your value started at 5 and the id was 7 instead of starting a count wasting db space just get the id and 5. $new_num = $row['id'] + 5;

Member Avatar for mschroeder
0
80
Member Avatar for niths
Member Avatar for liamfriel

Hello all, I am having some trouble getting my background image to show in FF and IE, I am using firefox web developer add-on and when I click edit css, the background image shows up, when I close the edit css it reverts back to having no background. [URL="http://www.costumeshopfinder.co.uk/test/"]here[/URL] is …

Member Avatar for diafol
0
171
Member Avatar for codewalkz

I am a bit confuded as to why you would want to run the query again? The where sponsor = $sponsor should limit the results so the $sponsor you return would be the same as the $sponsor you originally queried for.

Member Avatar for codewalkz
0
153
Member Avatar for whiteyoh

[CODE] function get_lat_long($postcode) { #change to your local domain i.e. .com $domain = "co.uk"; $url = "http://maps.google." . $domain . "/maps/geo?q=" . urlencode($postcode) . "&output=json&key=".maps_key; $curl = new curl(); $json = $curl->get_page(array("url"=>$url)); $store_data = json_decode(str_replace("&quot;","\"",htmlentities($json))); //Take care of accents $lng = $store_data->Placemark[0]->Point->coordinates[0]; $lat = $store_data->Placemark[0]->Point->coordinates[1]; //Return if($lng && $lat) { …

Member Avatar for whiteyoh
0
200
Member Avatar for xo_vicke93_xo

set up a cron job to run everymidnight and do a mysql delete where date < time() if you are storing your dates in timestamp format. If you have cpanel setting up a cron job is quite easy.

Member Avatar for liamfriel
0
98
Member Avatar for caro88

run the first query (loan) then do this [CODE] if(mysql_num_rows($loanquery1) > 0){ //loans }else{ //books } [/CODE]

Member Avatar for liamfriel
0
62
Member Avatar for SKANK!!!!!

[QUOTE=SKANK!!!!!;1194985]thanks this seems like the easiest way but where exactly do i put this code? how do incormporate it into my code i posted originally? any help would be appreiciateed.[/QUOTE] [CODE] $dir = opendir ($path); rsort($dir); while (false !== ($file = readdir($dir))) { if (strpos($file, '.png',1)) { echo "$file <br …

Member Avatar for mschroeder
0
171
Member Avatar for sam023

Also optimise your queries - do you need to run a query inside a loop of another query or can you use JOIN, also do you have primary keys defined. Do you place LIMITS on results so that you only query the records you require? All of these and more …

Member Avatar for sam023
0
102
Member Avatar for slucia

if you have a cpanel web host you should be able to set up a cronjob quite simply in the main menu

Member Avatar for diafol
0
73
Member Avatar for JERRYBOY78

Simply Change: [CODE]$results = mysql_query("SELECT Title FROM News ORDER BY Newsid DESC", $db);[/CODE] To: [CODE]$results = mysql_query("SELECT Title FROM News ORDER BY Newsid DESC LIMIT 4", $db);[/CODE] This will tell mysql to limit the query to the first 4 results making the query faster. As for putting in the div …

Member Avatar for liamfriel
0
94
Member Avatar for sam023

Since every new record is a standalone INSERT query you might be better off counting manually by incrementing a variable? [CODE] $count = 0; while(){ mysql_query("INSERT into.......") or die(mysql_error()); $count++; } [/CODE]

Member Avatar for sam023
0
131
Member Avatar for Barrett1

This is what you should do: [CODE] //set counter $a = 0; while(){ //check if counter is at start (0) if($a == 0){$results .= '<div class="result"><p>';}//Display at start of a block of 4 results $a++; $results .=''.$result.''; if($a == 4){ //reset counter so it is as start again $ = …

Member Avatar for Barrett1
0
108
Member Avatar for Pooja J.

last.php is taking $_POST values that to not exist in page3.php thereby overwriting the $_SESSIONS Remove from last.php: [CODE] $_SESSION['value'] = $_POST['value']; $_SESSION['value2'] = $_POST['value2']; $_SESSION['value3'] = $_POST['value3']; [/CODE] And your values should remain in tact.

Member Avatar for liamfriel
0
148
Member Avatar for sarithak

I have been reading that some browsers retain the HTML entities of encoded chars try: [CODE] htmlentities() or htmlspecialchars(). [/CODE] before encoding. [url]http://php.net/manual/en/function.urlencode.php[/url]

Member Avatar for sarithak
0
93
Member Avatar for rukshilag

[CODE] $query = "SELECT * FROM `tablea`, `tableb` WHERE `tablea`.`id` = `tableb`.`aid` AND `tablea`.`id`='".$x."'" ; [/CODE]

Member Avatar for liamfriel
0
103
Member Avatar for riddleyw

strip_tags removes php tags also: for javascript etc i use this function: [CODE] #this will strip javascript/html then prepare the script for inserting into database function make_safe($string) { $string = preg_replace('#<!\[CDATA\[.*?\]\]>#s', '', $string); $string = strip_tags($string); $string = htmlentities($string, ENT_NOQUOTES, 'UTF-8', false); $string = stripslashes($string); $string = mysql_real_escape_string($string); return $string; …

Member Avatar for diafol
0
78
Member Avatar for diafol

When someone clicks reset you could ajax the deletion of the current db record, or create a new one?

Member Avatar for liamfriel
0
132
Member Avatar for JuliaNell

kinda like this: [CODE] $username = mysql_real_escape_string($_POST['username']); //check if username exists $check_user = mysql_query("SELECT * FROM `users` WHERE username = '".$username."'") or die(mysql_error()); if(mysql_num_rows($check_user) > 0){ //user exists do some code echo "user already exists"; die(); }else{ //username is available } [/CODE]

Member Avatar for liamfriel
0
69
Member Avatar for cwarn23

[QUOTE=cwarn23;1130055]What do you mean by "run a muck"? I thought it would be wise.[/QUOTE] It was wise of you to let us know - but not everyone on this site is wise.... or nice! Gratz on nearly cracking it though

Member Avatar for cwarn23
0
651
Member Avatar for hardinera

in what format do you store your check_in & check_out data? If its a timestamp you can make a comparison between them but if is like 1 Jan 2010 you might have some trouble making a comparison.

Member Avatar for liamfriel
0
88
Member Avatar for cane23

a way to avoid the error would be to check if it exists before unset() - also setting the value to NULL or FALSE. if(isset($_SESSION['credit_total'])){ unset($_SESSION['credit_total']); //$_SESSION['credit_total'] = false; //$_SESSION['credit_total'] = NULL; }

Member Avatar for liamfriel
0
84
Member Avatar for Pooja J.

The file fields do not get sent via $_POST - they are sent in PHP via $_FILE. there are various tutorials on uploading and changing files names.

Member Avatar for hashinclude
0
101
Member Avatar for WoW Me Web Girl

where ever you print our comment use html_entity_decode(); function i.e. [CODE] echo html_entity_decode($comment); [/CODE]

Member Avatar for liamfriel
0
71
Member Avatar for digital-ether

I had this error from referring to http files inside a https location. Apparently this can happen even with images and any external data.

Member Avatar for digital-ether
0
204
Member Avatar for darrylpatterson

I share the same view as cwarn. eventually website design will be as simple as talking to a computer about what you want. Website development has been made easier over the years if you look at the difference between python and php, sure they can both achieve the same things …

Member Avatar for OS_dev
-1
114
Member Avatar for kuteinheart

Php has no problem with HTML tags the problem lies in the header the email is sending out - it is not telling the mail program that the email contains HTML. emhmk1's solution should give you what you are looking for.

Member Avatar for liamfriel
0
85
Member Avatar for fuggles

what is wrong with it? does it enter into the database but the values are not there? Otherwise the die() would give you an errror?

Member Avatar for liamfriel
0
87
Member Avatar for letlet_pogs

You could set the values in sessions or hidden form fields and then process them at the end(this method is inadvised for secure information).

Member Avatar for liamfriel
0
78
Member Avatar for muralibobby2015

Think this is it, just apply your db info to teh $db_text variable; [CODE] $db_text = $db_info[text]; echo substr($db_text, 0, 400); if(strlen($db_text) > 400){ echo "........ Read More"; } [/CODE]

Member Avatar for pushpakalpana
0
138

The End.