94 Posted Topics

Member Avatar for xwishmasterx

I think you want this: [CODE]<?php echo $this->_fetch_compile_include("includes/header.tpl", array('title' => $this->trigger_error("'lang' modifier does not exist", E_USER_NOTICE, __FILE__, __LINE__))); ?>[/CODE] Second to last semi-colon was unnecessary.

Member Avatar for edwinhermann
0
49
Member Avatar for rpgwebsolutions
Member Avatar for silh

How are you determining whether it is missing the first few lines? Are you printing it out? If the file contains certain escape characters, it can affect the print-out. For example, it may have CR instead of CRLF. Other escape sequences may trigger lines or characters not to show. The …

Member Avatar for prem2
0
116
Member Avatar for Mike516

[QUOTE=Mike516;1152891]The code should take the IDs and delete them from the tables but it isn't we are getting errors. Anyone see anything wrong?[/QUOTE] In your code, $players is an array. You can't specify an array in your SQL string. So you need to reference the correct array element, such as: …

Member Avatar for Mike516
0
107
Member Avatar for tustind

[QUOTE=tustind;1142860]I have a table in which each entry has a view counter. I would like to create a list that displays only entries that are within 100 views of a 1,000 view threshold. But, I want to also show each entry at any interval of 1,000 views. I.E., I would …

Member Avatar for edwinhermann
0
91
Member Avatar for codeblock

[QUOTE=codeblock;1138987]Hello all, I have a set of IF ELSE validation code ECHOING onto a php web page through a SWITCH staement. Everything works fine all error messages show up correctly. The problem is, after going through 3 conditons it starts to allow entry into my DB(mysql) all other entries goes …

Member Avatar for codeblock
0
185
Member Avatar for arunss

Instead of [CODE=php]if(isset($result['GetSessionListResult']['diffgram']['NewDataSet']['Table']))[/CODE] use [CODE=php]if (array_key_exists('table',$result['GetSessionListResult']['diffgram']['NewDataSet']))[/CODE]

Member Avatar for edwinhermann
0
95
Member Avatar for virtualmisc

[QUOTE=ElegantElephant;1131759][CODE]function validate_email($email) { if (strlen($email) < 3) { return false; } if (!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/',$email)) { return false; } else { return $email; } }[/CODE][/QUOTE] This code is close, but does not allow addresses ending in .museum or .travel. That's because the code limits the TLD to have between 2 and 4 …

Member Avatar for muralibobby2015
0
184
Member Avatar for xxmp

You have to replace $title with htmlspecialchars($title) when you output. i.e.: [CODE=php]$more_button=' <input type="button" id="button_help1" value="Summary" onClick="window.location='some_infos_research_en.php?title='.htmlspecialchars($title).''"> <input type="button" id="button_help1" value="Full description" onClick="window.location='upload/publications/en/'.$file.''">';[/CODE]

Member Avatar for edwinhermann
0
87
Member Avatar for Slammer

[QUOTE=Slammer;1123668]Hi, my problem is in regular expression. I need to catch from html code hyperlink tag's href atribute content if this hyperlink contains search condition. [/QUOTE] Here's what you want: [CODE=php]$a = "nail"; //search ctriteria between <a></a> $s =<<<EOF <a class="level2" onmouseout="this.style.background = '';" onmouseover="this.style.background ='#2c7cf4';" href="index.php?item&amp;module=1&amp;category=11" style=""> kaut kas …

Member Avatar for Slammer
0
128
Member Avatar for donaldw

Sounds good - I use a similar system to send me a message when a particular radio station plays the same song twice in one day (first caller gets $1,000). The songs are posted on their web site. Anyway, back to what you're doing: You could improve the cron side …

Member Avatar for donaldw
0
95
Member Avatar for cali_dotcom

If it is XML output I would parse it using the xml parsing functions. However, if it's not entirely XML (or not XML at all), then using preg_match_all should be fine. Here's some sample code to show you: [CODE=php]$b = <<<'ENDOFEXAMPLE' <translate id="4" token_id="0" variant_id="1">contents............</translate> blah blah blah <translate id="9" …

Member Avatar for cali_dotcom
0
139
Member Avatar for justted

Session data holds whatever you want it to. Client side, there's only a random token that can be "stolen" by hackers. Server side, while it's possible for them to steal your session data if they can break into the server you've probably got more to worry about. For example, they …

Member Avatar for vaultdweller123
0
85
Member Avatar for Hitman Mania

A simpler way would be this single-line solution: [CODE=php]print 'There are '.preg_match_all('/[aeiou]/i',$_POST["fname"],$matches).' in the string ('.$_POST["fname"].')';[/CODE]

Member Avatar for Hitman Mania
0
1K
Member Avatar for Wilmar1980

I can't quite tell whether this is the reason, but you need to ensure that not only are the permissions set on the end directory, but also (at minimum) execute permissions on all the parent directories required to traverse to that directory. In other words, suppose I'm in /one/two/three and …

Member Avatar for Wilmar1980
0
92
Member Avatar for Stefano Mtangoo

The site you showed uses images. Here's one of the rounded corner images on that site: [url]http://www.mtibwasugar.com/images/modtbo_t.gif[/url] Rounded corners (other than by images) is something that is part of CSS3. Check out [url]http://www.w3.org/TR/css3-background/[/url]

Member Avatar for SKANK!!!!!
0
184
Member Avatar for eggmatters

Hi EggMatters, To make your code work on either Windows or *nix platforms, use the constant [B]PATH_SEPARATOR[/B] in place of a slash. For example: [CODE=php]$stuff = file_get_contents("some_dir". PATH_SEPARATOR."another_dir". PATH_SEPARATOR.$filename);[/CODE] The constant PATH_SEPARATOR represents "/" on *nix systems and "\" on Windows systems.

Member Avatar for leviathan185
0
108
Member Avatar for Hummdis

That would be the best way. You'd do something like this: [CODE=php]foreach($_POST as $name => $value) { switch ($name) { case "colour": // logic here to handle the colour break; case "size": // logic here to handle the type break; case "type": // logic here to handle the type break; …

Member Avatar for Hummdis
0
178
Member Avatar for niche1

[CODE=php](!$var)[/CODE] To extend on what @Calver said, it tests whether a variable is false. The following variables will evaluated as "false": 1. NULL 2. Empty string 3. Boolean false 4. 0 (zero) 5. Non-existant variables

Member Avatar for edwinhermann
0
115
Member Avatar for masocha

[QUOTE=masocha;1026927]Sory for the bad code guys[/QUOTE] It's just terrible, I feel sick just thinking about it. Okay, I too have no idea what you're on about :D

Member Avatar for codejoust
-1
103
Member Avatar for danang

[QUOTE=danang;1021187]hi, i've got a problem, hmm...there are three groups (A,B, and C) and their IP address are: A ==> 10.204.xxx.xxx B ==> 10.205.xxx.xxx C ==> 10.206.xxx.xxx how to read an IP Address, but only for 2 octet, (10.204, 10.205, 10.206)? I want to put them on index.php, so: if user …

Member Avatar for danang
0
172
Member Avatar for JayGeePee

.htaccess can password protect portions of your site. If your private pages are intermingled with public pages in the same directory, you can create a .htaccess file to go in the root of your Web directory, like this: [CODE]<Files private_*> AuthUserFile /path/to/.htpasswd AuthName "Private" AuthType Basic Require valid-user </Files>[/CODE] That …

Member Avatar for edwinhermann
0
148
Member Avatar for abrocketman

You have an extra tab character after EOSTYLE; (line 29 in your code above) Delete that line and retype it, taking care not to add any extra characters after the semi-colon.

Member Avatar for abrocketman
0
286
Member Avatar for gamshid

I'll leave it to someone else to address the print question, but about copying and saving - it's impossible to restrict this. If the browser can see the PDF data, it can be downloaded to the computer.

Member Avatar for almostbob
0
1K
Member Avatar for shastry

If you're wanting to encrypt it so that clients can't "steal" your code, then there are a number of solutions out there - codejoust has suggested one (zend encoder). Zend is apparently very good but very expensive ($600 I think). There is also: Ioncube - [url]http://www.ioncube.com/sa_encoder.php[/url] ($199) Source Guardian - …

Member Avatar for edwinhermann
-1
156
Member Avatar for sereleg

Not sure why you're using define(). The syntax for define is [B]define(name,value)[/B] which is clearly not how you're using it. Don't you want echo() to actually output this text? And the "Navb" is completely out of context. You need to explain how and where the content of line 2 is …

Member Avatar for edwinhermann
0
54
Member Avatar for Roebuc

You forgot a } before "catch". Try: [CODE]function connect($db_host,$db_database,$db_user,$db_pass) { global $db_connection; try { $db_connection = mysql_connect($DB_HOST,$db_user,$db_pass, true); if(!$db_connection) { throw new Exception('MYQSL Connection Database Error: ' . mysql_error()); } else { $connection = true; } } catch (Exception $e) { echo $e->GetMessage(); } } [/CODE]

Member Avatar for Roebuc
0
2K
Member Avatar for andym67

As ardav says, you need urlencode, but you should not use htmlentities. YOu only use htmlentities when you are outputting HTML. The header is not HTML - it's part of the underlying HTTP protocol.

Member Avatar for diafol
0
169
Member Avatar for TLCJohn

[QUOTE=almostbob;999171]unique, and random are mutually exclusive[/QUOTE] They may mean different things, but they're not mutually exclusive. For them to be mutually exclusive would mean that anything unique cannot be random and anything random cannot be unique. It is actually possible to generate something that is both random and unique (the …

Member Avatar for diafol
0
2K
Member Avatar for CFROG

If you want to 'attach' a URL to your submitted data, the use GET. Otherwise use POST. One example of wanting to have a URL (and therefore using GET) is as follows: Let's say you have a news site. Each story has a unique ID. There is one PHP script …

Member Avatar for cwarn23
0
173
Member Avatar for chupinette

Just to add to Chris's reply, there's also PHPshadow ([url]http://www.phpshadow.com[/url]) if you're deploying on Linux/BSD/Mac OS servers.

Member Avatar for chupinette
0
110
Member Avatar for jrw0267

That would only work if register globals is on. Also you have the following errors: - erroneous backslash before the ampersand - not using urlencode for URL variables - not using the proper HTML representation for the ampersand So try this: [CODE=php]echo "<param name='FlashVars' value='mp3=Slipknot-Duality.mp3&amp;bgcolor1=".urlencode($_GET["rgb"])."&amp;showinfo=1&amp;autoplay=0&amp;showstop=1&amp;showvolume=1'>";[/CODE]

Member Avatar for edwinhermann
0
90
Member Avatar for ayesha789

That's a short way of assigning a variable a value that spans multiple lines and includes special characters that would normally interfere with the PHP language. It's called NOWDOC (see [url]http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc[/url]) Consider this example: [CODE=php]$text = <<<SPECIAL_LABEL The quick brown fox jumps over the lazy dog. SPECIAL_LABEL[/CODE] This assigns the …

Member Avatar for ayesha789
0
106
Member Avatar for armyguydave69

You'll need to do the distance calculation in mySQL. It's not that hard - I've taken your code and run a quick test on my server. The only thing is you haven't said what your database tables are like, so you'll need to modify the table name, table columns and …

Member Avatar for edwinhermann
0
119
Member Avatar for sam023

There is a way to specify this in HTML, but not all browsers adhere to it. Use the attribute [B]accept[/B] in the [B]<form>[/B] tag. Assign it comma-separated MIME types. For example: [CODE=html]<form accept="image/gif,image/jpeg" enctype="multipart/form-data" action="upload.php" method="post">[/CODE] See [url]http://www.w3.org/TR/html401/interact/forms.html#h-17.3[/url] for more information.

Member Avatar for edwinhermann
0
101
Member Avatar for carie

[QUOTE=carie;993650]Hello, I'm working on a recursive loop subcategory system. The code below is ALMOST where I need it. The last thing I'd like to do is indent each subcategory based on levels deep, rather than just separate by commas. I can't seem to wrap my head around it. Any suggestions? …

Member Avatar for carie
0
170
Member Avatar for decimo

foreach ($rows as $rows) is invalid - you can't use the same variable name twice. Try this: [CODE=php]$result = $database->query('SELECT * FROM testtable ORDER BY timestp DESC;'); $rows = array(array()); while ( $tmp = $db->fetch_assoc( $result ) ) { $rows[] = $tmp; } foreach ( $rows as $row) { echo …

Member Avatar for edwinhermann
0
494
Member Avatar for csharplearner

And even then the analogue hole remains, although admittedly only a small percentage of people would go to the trouble. Tools like Quicktime can record the screen (or parts of the screen) as a movie with sound. If it's playable, it's recordable.

Member Avatar for edwinhermann
0
127
Member Avatar for Renzokouken_22

The "headers already sent" error is encountered when you are trying to send a header (usually with the [B]header()[/B] function), but that output has already started (usually through echo(), print() or similar, or something outside of PHP). The reason for the error is that once output has started, you cannot …

Member Avatar for Renzokouken_22
0
243
Member Avatar for macross

It's difficult to know your setup, so I'm only guessing, but one possibility is that your server doesn't accept short tags. I notice that in process.php, after <body> you open your PHP code with [B]<?[/B] Try using [B]<?php[/B] instead. You need to get it such that if someone browses to …

Member Avatar for macross
0
158
Member Avatar for tarunkhatri
Member Avatar for innocent.boys

Do the pages welcome.php, view.php, payment.php etc exist? You need to create them too. By the way I noticed a few errors: [CODE=php]<li><a href="direct.php?pagepage=view">Call History</a></li>[/CODE] should be [CODE=php]<li><a href="direct.php?page=view">Call History</a></li>[/CODE] and [CODE=php]<li><a href="direct.php?changepass.php">Change Password</a></li>[/CODE] should be [CODE=php]<li><a href="direct.php?page=changepass">Change Password</a></li>[/CODE]

Member Avatar for edwinhermann
0
3K
Member Avatar for innocent.boys

PHPshadow ([url]www.phpshadow.com[/url]) is another one and supports PHP5.

Member Avatar for hemgoyal_1990
0
323
Member Avatar for surf

Just a tip: You should be careful when outputting strings inside HTML. You should always use htmlspecialchars() to ensure that special HTML entities are properly encoded. Consider using: [code=php]echo '<option value=\"'.htmlspecialchars($key).'\">'. htmlspecialchars($value).'</option>\n';[/code]

Member Avatar for edwinhermann
0
127

The End.