Search Results

Showing results 1 to 40 of 1000
Search took 0.07 seconds.
Search: Posts Made By: cwarn23 ; Forum: PHP and child forums
Forum: PHP 2 Days Ago
Replies: 5
Views: 537
Posted By cwarn23
Try the following:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/?$ categories.php?name=$1
Forum: PHP 6 Days Ago
Replies: 4
Views: 206
Posted By cwarn23
I didn't spot that piece of php code. Should be as follows:
<label>Username</label><br />
<input name="name" type="text" value="<?php echo (isset($_POST['name']))? $_POST['name']:''; ?>"/>
<?php...
Forum: PHP 7 Days Ago
Replies: 4
Views: 206
Posted By cwarn23
Try attempt 4 the following:
<label>Username</label><br />
<input name="name" type="text" value="<?php if(isset($_POST['name'])) echo $_POST['name'] ?>"/>
<?php echo (!empty($arrErrors['name']))?...
Forum: PHP 7 Days Ago
Replies: 6
Views: 257
Posted By cwarn23
Netbeans... It may be good for Java but I wouldn't recommend using Netbeans for php unless you find php terribly hard. Instead use a php text editor (Not IDE) and things will be a lot simpler as php...
Forum: PHP 7 Days Ago
Replies: 3
Views: 172
Posted By cwarn23
Lets take into account the following code.
<?php
$message="This is a string<br>";
echo $message;

$message="variable";
$variable="This is the second string";
echo $$message;
?>
You will...
Forum: PHP 7 Days Ago
Replies: 14
Views: 467
Posted By cwarn23
That won't work due to invalid syntax. The following would be more like it.
mysql_connect("localhost", "root", "password");
mysql_select_db('my_database');
$query="UPDATE ".$table." SET...
Forum: PHP 8 Days Ago
Replies: 2
Views: 289
Posted By cwarn23
I do not believe phpmyadmin has an option to startup or restart mysql and in fact will report an error if mysql is not started. The best way to startup mysql is via command line and can be scheduled...
Forum: PHP 8 Days Ago
Replies: 14
Views: 467
Posted By cwarn23
Perhaps this:
$query="UPDATE ".$table." SET ".$sub_code."='".mysqli_real_escape_string($dbc, $marks)."' WHERE no='".mysqli_real_escape_string($dbc, $r_no)."' LIMIT 1";
mysqli_query($dbc, $query) or...
Forum: PHP 8 Days Ago
Replies: 14
Views: 467
Posted By cwarn23
Just that the mysqli_query() function is not in the official documentation. Also you could try the following code.
$query="UPDATE ".$table." SET ".$sub_code."='".mysql_real_escape_string($marks)."'...
Forum: PHP 8 Days Ago
Replies: 14
Views: 467
Posted By cwarn23
Also is there such function as mysqli_query(). Is it meant to be mysql_query() like the following?
$query="UPDATE ".$table." SET ".$sub_code."='".mysql_real_escape_string($marks)."' WHERE...
Forum: PHP 8 Days Ago
Replies: 1
Views: 202
Posted By cwarn23
A bit like my first post. If you are meaning you want to program your own php site from scratch to look like a wordpress site then you will have to realize that this is no easy job. You will find...
Forum: PHP 8 Days Ago
Replies: 14
Views: 467
Posted By cwarn23
Do you mean like this:
//data stored in $arr

for ($i=0;isset($arr[$i]);$i++) {
mysql_query('INSERT INTO `table` SET `column`="'.mysql_real_escape_string($arr[$i]).'"');
}
Hope it helps.
Forum: PHP 9 Days Ago
Replies: 1
Views: 209
Posted By cwarn23
If you mean all of the values are stored in the one cell or variable then the following will do the trick:
$var='one.two.three.';
$var=substr($var,0,-1);
$arr=explode('.',$var);
for...
Forum: PHP 9 Days Ago
Replies: 1
Views: 180
Posted By cwarn23
I'm no translator but I think that website is in Arabic. Impossible to read or understand. As for the question, the only oop I currently use is in php-gtk but hope to learn more soon. Also anybody...
Forum: PHP 9 Days Ago
Replies: 2
Views: 259
Posted By cwarn23
The following should do the trick the the result being in the $res array
<?php
$var=$_POST['box'];
$i=1;
$res=array();
$var=(empty($var))?array():$var;
foreach ($var AS $val) {
...
Forum: PHP 12 Days Ago
Replies: 8
Views: 329
Posted By cwarn23
Also if you want columns in the array then a 2 dimensional array will be required. For example
<?php
$htmltable=array();
for ($row=0;$row<21;$row++) {
for ($column=0;$column<6;$column++) {
...
Forum: PHP 12 Days Ago
Replies: 2
Views: 243
Posted By cwarn23
Have you tried the youtube video player. Simply copy and past the code shown to the side of a youtube video and you can view that video on your site. Only problem is that method is the video must be...
Forum: PHP 13 Days Ago
Replies: 5
Views: 376
Posted By cwarn23
Exactly and in addition to that your host may have turned off short tags in the php.ini file so you might need to use the full <?php.
Forum: PHP 13 Days Ago
Replies: 3
Views: 287
Posted By cwarn23
except you didn't change the extension. For example to include the javascript file you should use the following:
<script type="text/javascript" src="xyz.php"> </script>
Then in xyz.php you can...
Forum: PHP 13 Days Ago
Replies: 3
Views: 287
Posted By cwarn23
Simply give your javascript file a .php extension then php code may be used in the file. So for example your filename may be scripts.php and will display all of the required javascript using php.
Forum: PHP 13 Days Ago
Replies: 12
Views: 461
Posted By cwarn23
I see how that can be handy but another thing I have noticed with sites like google and youtube is that they seem to redirect users to their country code domain meaning there is a separate database...
Forum: PHP 13 Days Ago
Replies: 12
Views: 461
Posted By cwarn23
Just a note on that. Wikipedia receives 1,000 new articles every day and many more edited articles so it is possible to compare Wikipedia to ever changing websites such as Facebook. I guess it is a...
Forum: PHP 14 Days Ago
Replies: 3
Views: 219
Posted By cwarn23
Didn't realize you were trying to get those two variables to work but the data from the result is stored in the $data variable and should be possible to use the preg_match_all function to find the...
Forum: PHP 14 Days Ago
Replies: 3
Views: 219
Posted By cwarn23
Try this:
<?php
// create a new cURL resource
$ch = curl_init();
$demo='http://chaitu09986025424.blog.co.in/feed/rss/';
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL,...
Forum: PHP 14 Days Ago
Replies: 25
Views: 674
Posted By cwarn23
That is a basic mysql error which means mysql has been told to search for a column named id_tariffplan however no such column exists. A common problem for this is mis-spelling the column and not...
Forum: PHP 14 Days Ago
Replies: 12
Views: 461
Posted By cwarn23
Are you at all familiar with the mediawiki cms. That is the same cms wikipedia uses and it does not spread into millions of tables. Instead it has hundreds of computers that just process the...
Forum: PHP 14 Days Ago
Replies: 3
Views: 297
Posted By cwarn23
Here's a script from this article (http://syntax.cwarn23.net/PHP/Pagination_made_easy).
<?php
$pages_left=3;
$pages_middle=4;
$pages_right=2;

$total_pages=100;
if (!isset($_GET['page']) &&...
Forum: PHP 14 Days Ago
Replies: 12
Views: 461
Posted By cwarn23
Well actually I have been told in the mysql forum that if you design a table so that it has indexing you shouldn't ever need multiple tables for the one job. That is when designed properly because...
Forum: PHP 15 Days Ago
Replies: 4
Views: 245
Posted By cwarn23
Well cookies are designed to serve one domain only and google's login uses Java applets. So perhaps with googles login their Java applet could write to a file on the local system or something like...
Forum: PHP 15 Days Ago
Replies: 4
Views: 245
Posted By cwarn23
Cookies and sessions won't work because they are separate domains so I would suggest having them both read a common mysql database where user data will be stored so when a user logs into each, their...
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
The only other option is the below. If that doesn't work then it means there is something wrong with the apache httpd.conf file. I have experience that myself but can't find how to configure it...
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
Just saw on your first post it is http://localhost/user/jack
Try the following although there are a number of possibilities for this error...
RewriteRule ^/?user/([a-zA-Z0-9_]+)/?$...
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
Try to make sure that it rewrites to the correct location. So could you provide a url link to your php page mentioned in your htaccess file including domain and all.
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
Try this
RewriteRule ^user/([a-zA-Z0-9_]+)/?$ profile/?uname=$1 [NC,L]
RewriteRule ^user/([^a-zA-Z0-9_]+)/?$ errorpage.php [NC,L]
And don't forget to make that error page.
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
Shouldn't those symbols be encoded. Try using the php urlencode function on those symbols to see what the translation should be. That would be the most likely solution because such symbols can't be...
Forum: PHP 16 Days Ago
Replies: 3
Views: 317
Posted By cwarn23
You can take a look at this thread (http://www.daniweb.com/forums/thread239874.html) for a script that already has some of those abilities programmed in. But there would be a lot more programming to...
Forum: PHP 16 Days Ago
Replies: 12
Views: 406
Posted By cwarn23
Try perhaps this:
RewriteRule ^/?user/([^\.]+)/?$ /profile/index.php?uname=$1 [NC,L]
Also the second part the is where to needs to specify then entire address after the domain so for example the...
Forum: PHP 17 Days Ago
Replies: 3
Views: 260
Posted By cwarn23
Although you could use regex it would be better to use the following:
$url='http://www.youtube.com/watch?v=NMAYr709-9Y&feature=dir';
$var=explode('?v=',$url);
$var=explode('&',$var[1]);
echo...
Forum: PHP 17 Days Ago
Replies: 7
Views: 351
Posted By cwarn23
The reason why my script is a little more complex than that is because the script I wrote scans every page in the website specified. So in other words it will go to the specified page, grab all the...
Forum: PHP 17 Days Ago
Replies: 7
Views: 351
Posted By cwarn23
I have a template that I can give you and it is as follows:
<form method="post">Scan site: <input type="text" name="site" value="http://" style="width:300px">
<input value="Scan"...
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC