452 Posted Topics

Member Avatar for minitauros

I would like to execute some Javascript after the document has loaded and even after the document.onload functions have been executed. Situation: I'm loading a text-edit field through ajax. When the user submits the form, he is redirected to a PHP file. That PHP file redirects him back to "file.php" …

Member Avatar for minitauros
0
106
Member Avatar for minitauros

The case: On my site there are four profile types: persons, artists, companies and events. A user can create multiple profiles. Each profile can be connected to another profile. So a person-profile can for example connect to an artist-profile, but also to an event-profile, and an event-profile can connect to …

Member Avatar for smantscheff
0
129
Member Avatar for minitauros

What I would like to do is to create a repeating pattern inside a rewriterule. For example: RewriteRule ^([\w]+)/([\w]+)/(([\w]+)/([\w]+))*/?$ index.php?p=$1&s=$2(&$4=$5)* Breaking it down: On every page my ?p=BLA refers to a certain page, and every &s=BLA refers to a certain subpage. The rewriterule for this would obviously be: RewriteRule ^([\w]+)/([\w]+)/?$ …

Member Avatar for cwarn23
0
119
Member Avatar for minitauros

What I would like to do is to create a repeating pattern inside a rewriterule. For example: RewriteRule ^([\w]+)/([\w]+)/[B](([\w]+)/([\w]+))*[/B]/?$ index.php?p=$1&s=$2[B](&$4=$5)*[/B] Breaking it down: On every page my ?p=BLA refers to a certain page, and every &s=BLA refers to a certain subpage. The rewriterule for this would obviously be: RewriteRule ^([\w]+)/([\w]+)/?$ …

Member Avatar for cwarn23
0
301
Member Avatar for minitauros

Okay so me and a friend of mine are discussing the following: If you have 1. a table with 10 fields, each a varchar(255) or 2. a table with 10 fields, each a varchar(1billion) [B]Which would be better, performance wise?[/B] I say it won't matter, because MySQL reads the field …

Member Avatar for minitauros
0
105
Member Avatar for minitauros

In the ZEND Reference Guide I saw this: [CODE]$select = $db->select()->from('posts')->order('date_created DESC');[/CODE] Now I'm wondering: what does that second arrow do? What does using more than one arrow when working with an object do? And can I use it all the times? For example [CODE]$myclass->function()->anotherfunction()->hello;[/CODE]?

Member Avatar for minitauros
0
477
Member Avatar for minitauros

I'm wondering: Why would I need to use a static variable? When I initiate a class, that class remembers the value of a variable I declare in that class anyway, right? What does the [I]static[/I] part add to that? For example, what's the difference between [CODE]class Hello { public $variable; …

Member Avatar for cwarn23
0
120
Member Avatar for Danny159
Member Avatar for Danny159
0
75
Member Avatar for Inny

Seems like you forgot to close your [I]end[/I] tag on line 7, for starters. Edit: Nvm, I see it :).

Member Avatar for Inny
0
239
Member Avatar for _8Bit

[CODE]function randomHash($length) { if (!$length) $length = 6; $array = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9)); for($i=0; $i<$length; $i++) { $random = mt_rand(0, count($array)-1); $random_hash .= $array[$random]; } return $random_hash; }[/CODE] This creates a random hash with the length of $length. Add it to your database with a simple insert …

Member Avatar for Ichcha
0
212
Member Avatar for chris_j_haines

For example you could create a 128 length password field for a sha512 hash, which is much more secure than a sha1 hash. You would compare the form result with the database result, and if it matches, the user will be logged in. Something like: [CODE]$password = hash('sha512', $_POST['password']); // …

Member Avatar for chris_j_haines
0
176
Member Avatar for spixy

Just a wild guess, but maybe you could explode on a special character (the enter character, \n)? That would return an array of which each key would contain a line of text.

Member Avatar for spixy
0
118
Member Avatar for srijon

Just check whether your checkboxes are checked or not, and if yes, what their value is? All checkboxes and their values can be found in the $_POST data. :)

Member Avatar for madCoder
0
119
Member Avatar for riseguim

I don't know everything about regexps, but a dot should be escaped, or it will be treated as "any character". A dot matches any charachter if it is not escaped properly. Same goes for the comma and dash, backslash and ', in other words, all characters that have a function …

Member Avatar for minitauros
0
134
Member Avatar for Ender330

You could try: preg_match('/^\+?55[0-9]+$/', $string); \+? means: a + 0 or 1 times, 55: both need to be present [0-9]+, any number, 1 or more times.

Member Avatar for pritaeas
0
69
Member Avatar for azegurb

It's for example to show other coders that are working on the same project as you how they should use your class.

Member Avatar for MooGeek
0
124
Member Avatar for jorjah
Re: php

Yes, you can create a graph using commands like imageline etc. ([url]http://php.net/manual/en/function.imageline.php[/url]) You should search for a PHP Graph tutorial! :)

Member Avatar for vibhaJ
0
95
Member Avatar for surjeetk27

It means that PHP can't find the file specified. Are you pointing to the right file?

Member Avatar for vibhaJ
0
124
Member Avatar for mwenyenia07

To start at a value other than 1, add AUTO_INCREMENT xxxxx to a create query, like CREATE TABLE bla (this and that) AUTO_INCREMENT 1000

Member Avatar for vibhaJ
0
119
Member Avatar for jogesh_p

Change [L] to [L,R] might work. I'm not a .htaccess pro but I know that the R stands for "Redirect", so that's the first thing that comes into my mind when I read your issue.

Member Avatar for cereal
0
156
Member Avatar for Espenij

What cereal says. You need to add an underscore between the $ and SERVER, which makes it $_SERVER instead of $SERVER.

Member Avatar for minitauros
0
81
Member Avatar for bizfreak22

Your form appears not to have an input named "Notes" - that's the index PHP says you're missing, and that might be the problem.

Member Avatar for ananthaninfo
0
129
Member Avatar for saybabs

You mean uploading all files in a folder and attatching it to an email?

Member Avatar for G&G Designing
0
111
Member Avatar for minitauros

Hello there, I'm trying to create a rewrite condition for a set of rewrite rules. Currently this is what I have: HTML and CSS Syntax (Toggle Plain Text) [CODE]RewriteCond %{HTTP_HOST} ^/?forum [NC] RewriteRule ^([\w]+)/([\w]+)/?$ index.php?p=$1&s=$2 [NC,L,C] RewriteRule ^([\w]+)/?$ index.php?p=$1 [NC,L][/CODE] What I want is to have the following uri, [url]http://www.mywebsite.com/page1/page2[/url], …

Member Avatar for vibhaJ
0
137
Member Avatar for mhaselip
Member Avatar for mhaselip
0
132
Member Avatar for minitauros

Hello there, I'm trying to create a rewrite condition for a set of rewrite rules. Currently this is what I have: [CODE]RewriteCond %{HTTP_HOST} ^/?forum [NC] RewriteRule ^([\w]+)/([\w]+)/?$ index.php?p=$1&s=$2 [NC,L,C] RewriteRule ^([\w]+)/?$ index.php?p=$1 [NC,L][/CODE] What I want is to redirect [url]http://www.mywebsite.com/PAGE1/PAGE2[/url] to [url]http://www.mywebsite.com/index.php?p=PAGE1&s=PAGE2[/url], except when the URI starts with "forum" (for …

Member Avatar for leakbali
0
95
Member Avatar for skald89

You could try finding a tutorial somewhere? :) I'd suggest [url]www.good-tutorials.com[/url]

Member Avatar for Arkinder
0
83
Member Avatar for kukuruku
Member Avatar for tnjiric
-1
82
Member Avatar for sha1023012

The error must almost certainly be in the data you specified to connect to your MySQL database. For example you could have set a wrong username, password, host, etc. to connect to your database. Make sure you double check it, and then try again :).

Member Avatar for sha1023012
0
201
Member Avatar for 54uydf

You could make a full horizontally oriented image, maybe. What I mean is for example when you retrieve data from your database, you coun't how many boxes you're gonna have to make for each column, then you place those boxes underneath eachother (you will need to calculate where you're gonna …

Member Avatar for 54uydf
0
135
Member Avatar for Hani1991

The "var" prefix was used in PHP 4. In PHP 5, you don't need to use the word "var" to declare a variable. In PHP 5, however, a warning will be generated if error handling is set to E_STRICT.

Member Avatar for diafol
0
82
Member Avatar for Hani1991

Can't you just select the amount of votes that an option has received from the [I]pollvotes[/I] column, and then display the result behind the poll option?

Member Avatar for diafol
0
92
Member Avatar for minitauros

Because using the <base> tag is giving me some problems lately, I'm curious about what the best solution is to use together with mod rewrite. I use mod rewrite a lot, and the <base> tag helps me to keep the links to my css files, for example, working. I link …

Member Avatar for minitauros
0
123
Member Avatar for minitauros

Because using the <base> tag is giving me some problems lately, I'm curious about what the best solution is to use together with mod rewrite. I use mod rewrite a lot, and the <base> tag helps me to keep the links to my css files, for example, working. I link …

0
66
Member Avatar for 7kemZmani

It's not completely clear to me what your question is. Are you asking what SQL command you should use, are you asking what Javascript code you should use, or are you asking something else?

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for dyingatmidnight

Almost every time such an odd problem occured in one of my projects, it was like only one letter or one line that was written wrong or contained a spelling mistake that was causing the problem. You really need to check EVERYTHING very closely. session_start(); should be the first line …

Member Avatar for dyingatmidnight
0
534
Member Avatar for iamthwee

I'm using Google Webfonts myself, but it's too bad that not all browsers know how to work with custom fonts :(.

Member Avatar for iamthwee
0
150
Member Avatar for klemme

It should be: [CODE]if (!preg_match("/^[A-Za-z0-9]{3, 20}$/i", $_POST['brugernavn']))[/CODE] The {3, 20} part checks if the length is between 3 and 20 characters.

Member Avatar for klemme
0
4K
Member Avatar for abhi10kumar

I think you can achieve what I [B]think[/B] you want to achieve by creating a .htaccess file. Try seaching Google for htaccess tutorials or something like that :). With a .htaccess file you can rewrite your URI's. For example [url]http://www.example.com/index.php?query=hello[/url] could be displayed as [url]http://www.example.com/index/hello[/url].

Member Avatar for nivibala
0
176
Member Avatar for VengefulWrath

Sha1 is safer than md5, and it's also built in in PHP, so why not use sha1? :) Where md5 returns a 32 character long encrypted hash, sha1 returns a 40 character long encrypted hash. It may not seem like that's a lot of difference, but it is!

Member Avatar for diafol
0
267
Member Avatar for cliffcc

For security you should at least do both: create a .htacces file AND check if the user visiting the page is allowed to perform the actions he is about to perform (by, for example, matching his user rank - which was set when he logged in - against the user …

Member Avatar for diafol
0
111
Member Avatar for calebcook

If you put a "From:...." in your $headers, there's no need to add it again in your additional parameters :).

Member Avatar for minitauros
0
184
Member Avatar for minitauros

Hello. I'm not so good at Javascript, but I tried to write some code to obtain some form values and write those to a query string to use in AJAX. It seems to be working partially, but I don't understand what is going wrong. What happens is that in the …

Member Avatar for minitauros
0
778
Member Avatar for Number1awa

It's indeed what Zero13 says. Your function needs an id to make use of the getElementById function. However, you're not sending the id to the function when you call it in your HTML. You could try replacing onClick="getId(id);" by onClick="getId(this.id);" if you want to send the id from the element …

Member Avatar for diafol
0
121
Member Avatar for cliffcc

Usually, as Ardav says, visitors cannot even see your PHP code. Have you ever tried right clicking a website -> view source? Do you see PHP code there? :) (If that's what you mean).

Member Avatar for edwinhermann
0
218
Member Avatar for minitauros

Hello, I'm encountering an AJAX problem when I try to execute multiple AJAX requests at the same time. What I want to do is delete a message and display the status (succes or failure) of that in [I]div1[/I], and refresh the messages on the page in [I]div2[/I]. This needs (for …

Member Avatar for Airshow
0
437
Member Avatar for cmabill

Well, the variables you're using in these lines of code [CODE]$body_message = 'From: '.[color="red"]$field_name[/color]."\n"; $body_message .= 'E-mail: '.[color="red"]$field_email[/color]."\n"; $body_message .= 'Message: '.[color="red"]$field_message[/color];[/CODE] have not been defined in the code that precedes it (for as far as I can see), and therefore will be [COLOR="Red"]null[/COLOR] (if what I see here is …

Member Avatar for cmabill
0
278
Member Avatar for ckdoublenecks

Lines 28 - 30: [CODE]if($err!=""){ echo "Error in $sql: $err\n"; echo "Invoice Prep completed";[/CODE] You place an opening bracket there, but you never close it.

Member Avatar for ko ko
0
249
Member Avatar for phplover

Well, I don't think there's much difference between executing 4 different queries in one query and executing 4 different queries apart from eachother. I've never tried it, but I don't think executing 4 counts in one query will work. Besides that, COUNT just counts the rows that are selected, so …

Member Avatar for phplover
0
1K
Member Avatar for emily-bcot

Perhaps you should read about extending classes :). Child classes implement all functions of their parent. So if you have for example child class getUserByRid, which is the child of getUserByUid, it would look like: [CODE]class getUserByUid { // code.. } class getUserByRid extends getUserByUid { // this one contains …

Member Avatar for minitauros
0
175

The End.