1,376 Posted Topics

Member Avatar for MDanz

[QUOTE=HITMANOF44th;1191627]i would would suggest i dont know if this is the right way but i would make a table that has a index / username / post_id so every time the user would click on the new post it would write to the table that he saw it you can …

Member Avatar for cwarn23
0
99
Member Avatar for johncarreras
Re: FYI

Hi and welcome to daniweb. I see you have a mini tutorial and yes it may be php 101 but I hope you enjoy your time here. Good luck.

Member Avatar for cwarn23
0
73
Member Avatar for ssharifi

Not too clear as it looks like the text is copied directly from a homework book but if I'm correct what your looking for is ajax. This is where javascript can communicate with php without refreshing the page. There is a nice tutorial at [URL="http://www.tizag.com/ajaxTutorial/"]http://www.tizag.com/ajaxTutorial/[/URL] Enjoy.

Member Avatar for cwarn23
0
133
Member Avatar for sacarias40

The all famous classic mail bug. Try the following: [CODE]function sendVerificationEmail($email, $code){ $to = $email; $subject = "Please activate your account at ".SITE_NAME; $from = "registration@domain.com"; $headers = "From: $from\n". "Reply-To: support@domain.com\n". "X-Mailer: PHP/".phpversion(); $message = "Welcome to domain.com\n" . "We see that you recently opened an account with us.\n" …

Member Avatar for sacarias40
0
123
Member Avatar for cwarn23

Hi, I have a vps and soon a dedicated with 3.2GHz quad but now the devil has come back to haunt me (DNS). On my current vps I can get the domain cwarn23.info to work but all of my addon and parked domains don't work (eg. chatbac.net). They simply can't …

0
54
Member Avatar for sam023

Alternatively you may want to change the column type to a blob or char. But for a char type you will need to specify the maximum length of storage input. Also the type of character set you set a table to be can also make a difference.

Member Avatar for cwarn23
0
249
Member Avatar for brahimhackman

Could you please explain in more detail what your problem is and if necessary provide some code because it is hard to understand with very few details.

Member Avatar for brahimhackman
-1
115
Member Avatar for BigFormat

Try this [CODE]if (preg_match('/[^0-9,]/', $ids_list)) { echo 'No good!'; } else { echo 'OK!'; //only 0 to 9 and commas. }[/CODE]

Member Avatar for BigFormat
0
170
Member Avatar for niths

Could you elaborate on the question. Sounds like line 29 should be as follows [CODE]<form action="upload.php" method="GET">[/CODE] But I could be wrong as you haven't explained your question with enough detail. Also when sending pm's to me please just send a pm with a link to your topic page and …

Member Avatar for cwarn23
0
97
Member Avatar for aquaticdeity

[QUOTE]Why they have to find patterns in a http page?[/QUOTE] Well one reason is because all browsers need to be able to preg_match_all the html tags. The second reason is because javascript provides some regex functions which the browser needs to be able to process.

Member Avatar for cwarn23
0
45
Member Avatar for Tekkno

Maybe the following. [CODE]$results = mysql_query("SELECT column1, column2, date, time FROM table LIMIT RAND(),1"); $row_table = mysql_fetch_assoc($results);[/CODE] If that fails to return a row then rand() is returning a number higher than the number of rows present.

Member Avatar for diafol
0
200
Member Avatar for SKANK!!!!!

Do you mean like the following? [CODE]$fullurl = "http://www.mysite.com".$_SERVER['SCRIPT_NAME'].'?black='.$_GET['black'];[/CODE]

Member Avatar for SKANK!!!!!
0
196
Member Avatar for phobia1

I would suggest using curl to tap into another websites currency converter. Let me know if you would like an example as it would be kinda hard to make.

Member Avatar for waelm2010
0
372
Member Avatar for Designer_101

Although I rarely use xml there is a [URL="http://au2.php.net/manual/en/book.xmlreader.php"]xml reader library[/URL] and perhaps that will be the key to solving your problem. I haven't used the xml libraries before since I haven't used xml much but hopefully that link should be of some use to you.

Member Avatar for whiteyoh
0
116
Member Avatar for Encrypted

Try the following: [CODE]$user = stripslashes($_POST["user"]); $dirname = "./cp/userfiles/$user/"; if (is_dir($dirname)) { echo "The directory $user exists"; } else { mkdir("userfiles/$user", 0777); echo "The directory $user was successfully created."; }[/CODE]

Member Avatar for Encrypted
0
129
Member Avatar for niths

Try this. [CODE]$sql2="select allocatedmemory from projects where projectname='$projectassign'"; $data1=mysql_query($sql2) or die(mysql_error()); echo '$data1';[/CODE] [edit] Oops, and the echo will need changing to suit your purposes. What are you trying to do on the echo line, trying to display allocatedmemory? If so then try the following [CODE]$sql2="select allocatedmemory from projects where …

Member Avatar for cwarn23
0
92
Member Avatar for througheye

Perhaps [URL="http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html"]this tutorial[/URL] would help.

Member Avatar for cwarn23
0
157
Member Avatar for sallecpt

Do you mean to select from the database and count how many are selected. If that is the case then use the following: [CODE]<?php $result=mysql_query('SELECT * FROM `table` WHERE `Location`="City1"') or die(mysql_error()); echo mysql_num_rows($result);[/CODE] Hope that helps.

Member Avatar for sallecpt
0
155
Member Avatar for sam023

[CODE]$time_start = microtime(true); $r=mysql_query($sql); sleep(1); //let the server relax after such a big query. $time_end = microtime(true); $time_for_mysqlquery = $time_end - $time_start; $number_of_rows=mysql_num_rows($r); //works only for SELECT in mysql query[/CODE]

Member Avatar for sam023
0
132
Member Avatar for cwarn23

For a while I have been thinking this but never got around to saying it. As we all know hijacked threads is a big problem and the solution that came to my mind was perhaps to setup a function where all threads that are older than two years are automatically …

Member Avatar for WaltP
0
355
Member Avatar for Phil++

Although I haven't tried using imap with gmail I have heard of gmail api's that can be used (unofficial ones) where you can easily connect to gmail and send mail via gmail. So try googling for php gmail api or something like that.

Member Avatar for cwarn23
0
109
Member Avatar for prad27

This should be made a sticky. It means there is html or binary output before the function session_start(). Some IDE's put a binary code at the beginning of the file causing this error but one of the more common reasons is that you have some white spacing just before the …

Member Avatar for prad27
0
148
Member Avatar for Asimina

To unset a session simply use the following. [CODE]<?php session_start(); //first line of file //blah... $_SESSION=array(); //unset session[/CODE]

Member Avatar for metalix
0
165
Member Avatar for nelliott10

Yes there are several things wrong with that code. One is that the Update sql query seems to be updating with empty variables unless there was something I did not read inside the include(). Also your mysql query's are venerable to sql injections. In other words people can easily hack …

Member Avatar for cwarn23
0
91
Member Avatar for Carrots
Member Avatar for cwarn23
0
105
Member Avatar for metalix

So what exactly is the problem. I see on line 2 you need to add the second quote into the function input but other than that the code looks fine. Could you please explain what the question is as I see a pretty script with a description but no mention …

Member Avatar for cwarn23
0
114
Member Avatar for DevC++4.9.9.2

The easiest way to do it is just install Windows 7 on the machine then install a program called Virtualbox. With this program you can create virtual machines just like a vps but with the gui. So then you could allocate a certain amount of ram for Windows Server 2008 …

Member Avatar for DevC++4.9.9.2
0
208
Member Avatar for arunajasmine

I'm no Joomla expert but I would suggest googling around for a pre made solution such as a patch.

Member Avatar for cwarn23
0
85
Member Avatar for CoolAtt

It can be done on some sites simply by sending the same http request as the normal login process would send but many sites have security protocols in place which make it a little harder. I believe there is a firefox plugin that can record the http request info when …

Member Avatar for cwarn23
0
105
Member Avatar for sallycheng

I see your new to daniweb and all but could you please explain in a little more detail. I mean like a paragraph of english with only small code snippets that demonstrate the problem instead of the entire source. I'll be waiting for the second post in the morning but …

Member Avatar for cwarn23
0
114
Member Avatar for cwarn23

Hi, I have got a laptop, a desktop and soon will have a server but want to share the cpu between all of these machines so that if one computer crashes they all crash. In additon if a computer exceeds it current ram/cpu usage then it would grab cpu/ram from …

0
59
Member Avatar for kunyomi

Try replacing lines 33 to 50 with the following [CODE]<?php if (isset($_POST["$submit"])) { $id2 = mysql_real_escape_string(stripslashes($_POST["id2"])); $name = mysql_real_escape_string(stripslashes($_POST["name"])); $email = mysql_real_escape_string(stripslashes($_POST["email"])); $age = mysql_real_escape_string(stripslashes($_POST["age"])); $birthday = mysql_real_escape_string(stripslashes($_POST["birthday"])); $address = mysql_real_escape_string(stripslashes($_POST["address"])); $number = mysql_real_escape_string(stripslashes($_POST["number"])); $sql = "UPDATE contacts SET name='$name', email='$email', age='$age', birthday='$birthday', address='$address', number='$number' WHERE id2=$id2"; $result = mysql_query($sql) …

Member Avatar for kunyomi
1
502
Member Avatar for gsanluis

The normal way of redirection which even cpanel uses is making a .htaccess file. I would suggest following a few tutorials on making redirects with a .htaccess file.

Member Avatar for cwarn23
0
102
Member Avatar for pmarcusss

The http referrer information is not very accurate and is best to ignore whenever possible. Why are you trying to get the referrer information because perhaps there is a better way of doing the job such as sessions.

Member Avatar for cwarn23
0
128
Member Avatar for Phil++

Yes, php can read open delete change and close email boxes just like gmail or hotmail can. The library that does this is the [URL="http://au2.php.net/manual/en/book.imap.php"]imap library[/URL]. Also if you are planning on creating 50+ email's via php then I would suggest getting a managed vps as you might get into …

Member Avatar for cwarn23
0
97
Member Avatar for Dan08

Could you give us an example of your problem. A demonstration of how to use new lines in php is as follows. [CODE]$text='This is the first line\n'; $text.="This is appended to the first line\n"; $text.='This is the second line separated by a \n'; $text.="\nThis is the last line.";[/CODE] As you …

Member Avatar for Dan08
0
99
Member Avatar for Frankey

As well explained your post was I didn't exactly get the problem. From my understanding you want to use regex to extract links from html input. If that is correct then the following would be your solution. [CODE]<?php $html_input='<img class="a" title="htc-pure-1" src="http://www.site.com/wp-content/uploads/2010/03/htc-pure-1.jpg" alt="">'; preg_match_all('@\<img[^\>]+src\="([^"]+)"[^\>]+\>@Uis',$html_input,$output); $output=$output[1]; print_r($output);[/CODE]

Member Avatar for Frankey
0
203
Member Avatar for sutt0n

Try the following [CODE]RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?(.*)$ /index.php?page=$1 [L][/CODE]

Member Avatar for cwarn23
0
73
Member Avatar for ItecKid

[QUOTE]My question is; I am trying to create an associative array in which each element of $matches[1] is keyed to it's corresponding $matches[2]. What is the best way to do this?[/QUOTE] Could you elaborate on that or explain in more detail because some of those terms don't make any sense.

Member Avatar for cwarn23
0
78
Member Avatar for azegurb

If you want somebody to embed bbcode for you then I don't think many people will offer unless you put some effort into it. I have read that there is a [URL="http://au2.php.net/manual/en/book.bbcode.php"]bbcode library[/URL] or alternatively if that library isn't available on your webhost then you can use the recourse hungry …

Member Avatar for cwarn23
0
180
Member Avatar for cwarn23

Hi, I have made an encryption and decryption script for those who want to encode data and decode the encoded data. This script may especially be useful for those who do not have the mbstring library installed as it uses a math grid. So for example you can store the …

0
339
Member Avatar for andy_brain

Your regex should be as follows: [CODE] $replace = "#\[vimeo[^\]]+([0-9]+)\]#is"; [/CODE]

Member Avatar for andy_brain
0
109
Member Avatar for marinkapell1
Member Avatar for srilakshmitr7

Well why don't you upload them to your own site? That would be the ideal solution but if you wish to use youtube then post your code and the link to the tutorial you used and I shall attempt to debug it.

Member Avatar for BzzBee
0
59
Member Avatar for alex.tepes

With 30 to 40 TB of traffic you would probably be best to A - host with your own server at home with an isp that accepts unlimited traffic or B - you can risk yourself in one of those online scams with unlimited traffic. Personally I would go for …

Member Avatar for jamesl22
0
196
Member Avatar for psathish2

Did you make sure that there is no white spacing before the [ICODE]<?php[/ICODE]. Also what IDE are you using. Try opening your file in the old fashion windows notepad and delete any invisible white spacing before the < symbol at the beginning of the file. Some IDE's place a binary …

Member Avatar for cwarn23
-1
171
Member Avatar for niths
Re: php

I received your pm and your code should be as follows. [CODE]<?php ob_start(); @session_start(); require_once ("check.php"); createsessions($username,$password,$userid,$projectid); $con=mysql_connect("10.70.1.50","invensis","invensis"); if(!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database_myproject",$con); $sql="SELECT projectname from projects where createdby='$_SESSION[username]'"; mysql_error(); $result=mysql_query($sql); $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["projectid"]; $projectname=$row["projectname"]; $options.="<option value=\"$id\">".$projectname.'</option>'; } $sql2="SELECT * FROM users where …

Member Avatar for niths
0
117
Member Avatar for Xlphos

[QUOTE]Is there anyway to delete your own post?[/QUOTE] The answer to this is no for a good reason. I'm sure that people like Dani don't want the whole of daniweb being deleted because of deleted posts so IMO it is best to [U]not[/U] be able to delete posts. Also why …

Member Avatar for Nick Evan
0
213
Member Avatar for OS_dev

[QUOTE=cscgal;1171746]The long page loads (including all the http requests) are a result of the ads, I'm afraid.[/QUOTE] I have tried using adblock for Opera but although removing the ads makes some difference it still takes ages for the gray forum menus to respond. My speed is 64kbps and the only …

Member Avatar for cwarn23
1
141
Member Avatar for xxmp

[QUOTE=ardav;1172565]I'm not saying it can't be broken, but it's pretty good - sufficient for me anyway. SHA variants are also worth looking at. Note - this is hashing, not encrypting. Encryption involves an algorithm creating some ciphertext which can be decrypted with an appropriate key. md5 cannot be decrypted or …

Member Avatar for diafol
0
108

The End.