Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2006, 02:44 PM   #1 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Help need for php code

I am creating a php script so that ppl can submit articles.

What code can I use so that when ppl tyle
<a href="http://www.domain.com">http://www.domain.com"</a> it will be converted to the actual link when the articles goes live?

I tried htmlentities($article_body) but it does not work, can anyone help me here? thanks
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 02:54 PM   #2 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
I am willing to help you, if you could be more specific
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 02:57 PM   #3 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Quote:
Originally Posted by helloworld
I am willing to help you, if you could be more specific
if it is not too much trouble for you, you can go to
http://www.bedroomfurniturestores.com/articles

you can register an account and then just write something with <a href>, you should see the problem i am refering to here
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 03:29 PM   #4 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
trying to create a new account I get this,


Fatal error: Call to undefined function: outputstor() in /var/www/public_html/platform/html3/articles/header.php on line 28


looks like it's trying to call a function that doesn't exsist?
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 03:37 PM   #5 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Quote:
Originally Posted by helloworld
trying to create a new account I get this,


Fatal error: Call to undefined function: outputstor() in /var/www/public_html/platform/html3/articles/header.php on line 28


looks like it's trying to call a function that doesn't exsist?
thanks very much, actually right now my question is solved and i just fixed that page, but i do have another question here:

I did a upload image script, but it gives me this message:
move_uploaded_file(): open_basedir restriction in effect

I don't have full control over the server, is it something wrong with the permission?
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 03:45 PM   #6 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Quote:
Originally Posted by GoWFB_SEO
thanks very much, actually right now my question is solved and i just fixed that page, but i do have another question here:

I did a upload image script, but it gives me this message:
move_uploaded_file(): open_basedir restriction in effect

I don't have full control over the server, is it something wrong with the permission?
Use phpinfo.php
Code:
<?php phpinfo(); ?>
and find "open_basedir." If the setting is something other than "no value" then you might have to use that directory.

How did you fix the other problem?
PHP htmlspecialchars?
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 05:00 PM   #7 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Quote:
Originally Posted by helloworld
Use phpinfo.php
Code:
<?php phpinfo(); ?>
and find "open_basedir." If the setting is something other than "no value" then you might have to use that directory.

How did you fix the other problem?
PHP htmlspecialchars?
yes, under local value, i see something and "no value" under master value

the directory show in "local value" is the upper directory", so when I assign image directory, should I use

$Image_dir = "../directory-path" ??


for that problem, someone told me to use "stripslashes",

is there a code so that when I type http://www.domain.com, it will automatically become a link? (without using <a href>)
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 09:36 PM   #8 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Quote:
Originally Posted by GoWFB_SEO
is there a code so that when I type http://www.domain.com, it will automatically become a link? (without using <a href>)

Code:
<?php //check what?? could possibly use a $GET_['text'] to change a form // $input = "http://www.yahoo.com is a great place to visit"; ///change it/// $input = trim($input); $input = htmlspecialchars($input); $input = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">Email</a>',$input); $input = preg_replace('=([^\s]*)(www.)([^\s]*)=','<a href="http://\\2\\3" target=\'_new\'>\\2\\3</a>',$input); //echo modified input// echo "$input"; ?>
This code will do

IE:

http://www.yahoo.com
www.yahoo.com
you@yahoo.com "converted to a mailto that says email"

what it will not do is,

http://yahoo.com

hope it helps, just didn't have much time today

Last edited by helloworld; 07-06-2006 at 09:42 PM..
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2006, 01:06 AM   #9 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Quote:
Originally Posted by helloworld
Code:
<?php //check what?? could possibly use a $GET_['text'] to change a form // $input = "http://www.yahoo.com is a great place to visit"; ///change it/// $input = trim($input); $input = htmlspecialchars($input); $input = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">Email</a>',$input); $input = preg_replace('=([^\s]*)(www.)([^\s]*)=','<a href="http://\\2\\3" target=\'_new\'>\\2\\3</a>',$input); //echo modified input// echo "$input"; ?>
This code will do

IE:

http://www.yahoo.com
www.yahoo.com
you@yahoo.com "converted to a mailto that says email"

what it will not do is,

http://yahoo.com

hope it helps, just didn't have much time today
thanks a lot, helloworld!! you really gave me a lot of help and i really appreciated it

just have one unswered question here,
for that upper level directory, i tried to use "../", but it seems still does not work
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2006, 02:47 AM   #10 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Your welcome!

Did you try this:

$Image_dir = "../directory-path/"

Let me know if that works out

It's possible the host is not allowing it.

This one I am not quite sure about

Last edited by helloworld; 07-07-2006 at 03:15 AM..
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2006, 03:22 AM   #11 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Also I believe with your setup it's not allowing you to access files outside the directory or sub directories so that may be a problem.

It's kind of hard to tell, not knowing much about the setup, and what's happening.

It seems to be a path issue though
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2006, 09:27 AM   #12 (permalink)
Member
 
GoWFB_SEO's Avatar
 
Join Date: 06-01-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

GoWFB_SEO is liked by many
Send a message via MSN to GoWFB_SEO
Quote:
Originally Posted by helloworld
Your welcome!

Did you try this:

$Image_dir = "../directory-path/"

Let me know if that works out

It's possible the host is not allowing it.

This one I am not quite sure about
It takes me about 3 hours and finally i got it solved (I didn't know I have permission to other paths, i am a master level )

Thanks again, helloworld
GoWFB_SEO is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2006, 03:28 PM   #13 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
your welcome, glad to hear you got it working
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS code daniel0012 Coding Forum 4 03-12-2007 12:15 PM
BB code url markov Web Design Lobby 1 11-03-2006 08:13 PM
Google Code Search - Code Search Engine from the Big G Avinash Coding Forum 2 10-05-2006 11:10 PM
need help with a code kopythat Coding Forum 10 03-11-2004 06:31 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:49 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.