708 Posted Topics

Member Avatar for SKANK!!!!!

You can also do: [code] $query = mysql_query("SELECT * FROM table"); while( $arr = array_map('stripslashes',mysql_fetch_array( $query )) ) { echo "ID: {$arr['id']} VALUE: {$arr['value']}\n"; } [/code]

Member Avatar for somedude3488
0
93
Member Avatar for apease11

You have parenthesis around the REMOTE_ADDR. It thinks you are trying to call a function with the name of the value of $_SERVER (which is an array) thus causing your "function must be a string" error.

Member Avatar for apease11
0
126
Member Avatar for SKANK!!!!!

Captchas are annoying. You can easily just use form timeouts and tokens. They actually work better.

Member Avatar for SKANK!!!!!
0
111
Member Avatar for itsrahulk

Or you can look around on the php.net manual and find the nice [icode]dirname[/icode] function.

Member Avatar for somedude3488
0
108
Member Avatar for egturnkey

This is kind of pointless, because anyone with a little knowledge of php can easily go in and remove the part of the code that checks if the page is licensed or not.

Member Avatar for somedude3488
0
141
Member Avatar for LutherVespers

You shouldn't have a multiple tables that serve the same purpose. Even though the organization is better, it hinders performance. You should have a blog table that holds the different blogs and assigns an id to each one (via auto_increment). Then you have a post table that handles all post …

Member Avatar for diafol
0
133
Member Avatar for coleguitajuan
Member Avatar for Tekkno

Its a mysql error. Read the mysql manual about DELETE. The answer is pretty obvious.

Member Avatar for Tekkno
0
82
Member Avatar for thatguy888

First of all don't do that. You don't have anything validating the data. This creates a problem. Anyway, all you have to do is replace the ' with " in the header function.

Member Avatar for thatguy888
0
92
Member Avatar for ChazMan

i think the item you are evaluating is an object and needs to converted to a string to be read like that. maybe this will work (just a guess) [code] if (gettype($var) !== 'string') { if (settype($var,"string")) { echo $var . ' set to string'; } else { echo $var …

Member Avatar for jericho034
0
374
Member Avatar for Venom Rush

Your problem stems from that the fact that php will try and convert anything that is not a number into a number when trying to add it (the +=). Most of the time, it just turns into a nice 0. Remove the plus sign.

Member Avatar for Venom Rush
0
124
Member Avatar for coleguitajuan

Read the page data, format it, and get the data you need. file_get_contents is a good place to start. Use fopen ect for older versions of php.

Member Avatar for somedude3488
0
73
Member Avatar for lobas

Either use the ingenious function like [icode]is_numeric()[/icode] which checks if certain data (like an id in a url) is a number or use type-casting which will convert it to one no matter what. Also, the [icode]mysql_real_escape_string()[/icode] function was made for a reason.

Member Avatar for somedude3488
0
90
Member Avatar for saveyourtime
Member Avatar for somedude3488
0
77
Member Avatar for K?!
Member Avatar for aditi_19

I think you are going about this the wrong way. Just use a regular auto_increment primary key field and then store the year in the rows themselves under a 'year' column. Or you can just store the time the project was created in the database, which you can easily derive …

Member Avatar for somedude3488
0
101
Member Avatar for vtek

Replace ” or “ with " (just a regular quotation). Replace ’ with ' (just an apostrophe)

Member Avatar for langsor
0
135
Member Avatar for somedude3488

Recently, I started on a new venture in which many sites will be built off the same base files. Pretty much if I change one file it will affect all of my sites. This has its ups and downs, but since the ups outweigh the downs I am going to …

Member Avatar for somedude3488
0
159
Member Avatar for Toxikr3

Use a cron job to set users offline after a certain amount of time. Just have it run every 5-10 minutes and that will solve the problem without having to rely on javascript to do it (which is not a good thing to do).

Member Avatar for Toxikr3
0
241
Member Avatar for Menster

Are you talking about PayPal IPN? If so, they have an api that validates the data they post to your site. You will just have to spend an hour trying to figure out where they hell the put it on their site.

Member Avatar for Menster
0
131
Member Avatar for vanessia_1999

Instead of [icode]<?=$prod_options;?>[/icode] try [icode]<?php echo $prod_options; ?>[/icode]

Member Avatar for vanessia_1999
0
187
Member Avatar for vanessia_1999

Before you append to a variable you need to first define it. Just add [icode]$prod_options = '';[/icode] and [icode]$color_options = '';[/icode] before their respective while statements. Also, that is just a notice. Not really an error. You can get rid of them by changing error reporting settings.

Member Avatar for vanessia_1999
0
177
Member Avatar for zeusofolus

Sorry it took me so long to reply. I have been busy. Put: [code] echo '<pre>' . print_r( $_POST,true ) . '</pre>'; [/code] somewhere on the page to check to make sure the post data is correct. Then put: [code] echo '<pre>' . print_r( $items,true ) . '</pre>'; [/code] towards …

Member Avatar for zeusofolus
0
217
Member Avatar for zeusofolus

This should work as long as you have an id field in the item table (which you should): [code] <?php $page_title = 'Place A New Order'; require_once('startsession.php'); require_once('header.php'); require_once('appvars.php'); require_once('connectvars.php'); require_once('navmenu.php'); $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $items = array(); $query = mysqli_query( $dbc,"SELECT `ItemID`,`ItemName`,`ItemCat`,`ItemPrice`,`ItemAmount`,`ItemUnit` FROM `items` ORDER BY `ItemCat` …

Member Avatar for zeusofolus
0
750
Member Avatar for iThaos

You can use magic methods to do it if you have php5. [url]http://us.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods[/url] I won't go into anymore depth, it's all there.

Member Avatar for iThaos
0
114
Member Avatar for Barefootsanders

Those are called superglobals and they will work inside a class. Also the way you called the method in the if statement is incorrect. I hope you know that. FYI: _POST and _GET are part of _REQUEST. Make sure you use the specific request type. Using _REQUEST isn't the best …

Member Avatar for iThaos
0
1K
Member Avatar for ayesha789

Look into the [url=http://www.php.net/date]date[/url] function. Please search for a solution before create a thread.

Member Avatar for ayesha789
0
378
Member Avatar for pbt

You can but its not recommended. Its better to store them on the server. You can read the file contents into a longblob field in a database. To retrieve it you need to get the contents from the database, then echo it out to the browser with the correct headers.

Member Avatar for somedude3488
0
98
Member Avatar for bhavnaJobcentre

What you are looking for is pagination. Google it and you will find plenty of websites to help you.

Member Avatar for diafol
0
223
Member Avatar for dwdata

[QUOTE=dwdata;913680]Oddest thing??? This is my CODE: [CODE] // Get all the Emails to include for a BBC bulk email $query = "select Email FROM Ev_SchVolunteers WHERE id_Event='$id_Event'"; print_r($query); $results = mysql_query($query) or die("Error performing query"); //print_r($results); $bcc_email = mysql_fetch_assoc($results); $index = 1; $BCC = ''; $email_count = count($bcc_email); print_r($bcc_email); print_r($email_count); …

Member Avatar for somedude3488
0
209
Member Avatar for stevenpetersen
Member Avatar for Josh Connerty
0
238
Member Avatar for dwdata
Member Avatar for ayesha789

Why not use ajax? Its better than having php create the javascript which adds to the page size and load time.

Member Avatar for ayesha789
0
135
Member Avatar for dwdata

Security is a big deal for me. I hate seeing code with holes in it and how easily it would be for someone to hack it. I have a good login security login example I can post. If you want to see it let me know. As for your question, …

Member Avatar for Toxikr3
0
163
Member Avatar for fireslug

Can we see the code that generates that error? Some simple logic changes should fix the problem.

Member Avatar for fireslug
0
109
Member Avatar for dwdata

You need to change the name of the instrument select element to "Instrument[]". Then when adding to the database run [icode]implode(',',$Instrument);[/icode] because it will return an array of selected elements. Implode will put them into a comma separated string so it can be put into the database. On the update …

Member Avatar for dwdata
0
191
Member Avatar for Barefootsanders

I wouldn't use a regular expression for something like this. I am not the best with it and a php function to do it wouldn't be hard. [code] function splitString( $data,$len=50 ) { $data = explode( ' ',$data ); $result = array(); $i = 0; foreach( $data as $str ) …

Member Avatar for somedude3488
0
135
Member Avatar for elamigosam

From what you are saying, it sounds like you are wanting the br tags to be added as they type. This isn't possible with php. You would need to run nl2br() once the form is submitted. If you are looking for that type of solution (which would be pointless, because …

Member Avatar for elamigosam
0
159
Member Avatar for sarithak

I have never had a problem with cache and the header function. I have updated your code by simplifying your code and making it more secure. I hate seeing so many security holes in peoples code. [code] <?php ob_start(); session_start(); include '../../includes/dbconnect.php'; $allowed = array( 'jpg','jpeg','png','pdf' ); $maxsize = 50000; …

Member Avatar for somedude3488
0
404
Member Avatar for mustafaneguib

I am guessing you never echoed $go to the page. If you would have, you would of noticed that $_SERVER['SERVER_NAME'] doesn't include http:// which would make that header call fail.

Member Avatar for digital-ether
0
170
Member Avatar for manizzi

You will need to use ajax to do this. There are many examples on the internet, google it.

Member Avatar for manizzi
0
86
Member Avatar for sassenach

What is your database layout like? How are you handling the children? Do you have any logic in place for those.

Member Avatar for sassenach
0
161
Member Avatar for stevenpetersen
Member Avatar for sarithak
Member Avatar for gretty

Things needed to program in php: 1. XAMPP. I have found this to be the easiest to get running on a windows system. If you get into php programming, get an old computer and put linux on it (I use Ubuntu). Nothing is easier than installing php and mysql on …

Member Avatar for diafol
0
211
Member Avatar for littletechie

You could do it all on the same page. Just put an variable in the url to tell whether or not the show the registration form.

Member Avatar for littletechie
0
118
Member Avatar for lifeworks

I think this is what you are talking about: [code] function create( &$var ) { $var = new $var; } [/code] to use define a variable and then call the function [code] $class = 'class_name'; create( $class ); echo $class->testing; [/code]

Member Avatar for somedude3488
0
68
Member Avatar for mrcniceguy

I wouldn't change the session timeout. I don't think its a good idea to keep a session going that long. You might want to look into cookies to solve that problem.

Member Avatar for somedude3488
0
137
Member Avatar for andrewsCWD
Member Avatar for somedude3488
0
67
Member Avatar for somedude3488

I am working on a personal framework and I have been trying to move all of my configuration variables into one central file and read them from there. I created a config class that traverses a large array, but I feel as I add more configurations to the application, its …

Member Avatar for somedude3488
0
356

The End.