close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with Registration form bindings.

Thread began 4/06/2020 1:42 pm by balexander389215 | Last modified 4/10/2020 11:17 am by Ray Borduin | 110 views | 24 replies |

balexander389215

Problem with Registration form bindings.

I've created a registration form and everything works fine, except... The input for Website. If the website and copied from an address bar and pasted into the form all is fine, if it is typed in including the http:// it works but if it is typed in with just www.etc then I get a 404 error and the address bar shows:
my_website/target_website.

For example when I create a new listing and type in a well know web address then check the database it shows up as typed in. www.webassist.com

Now when I go to the Profile it shows the link www.webassist.com but clicking on it produces the address:

http://www.songwritersinconcert.com/www.webassist.com

Here is the coding creating the link.

<a href="<?php echo($profileVs->getColumnVal("Website")); ?>" target="_blank"><?php echo($profileVs->getColumnVal("Website")); ?> </a>

Somehow it is adding the base website if http:// is not added.

If I had originally typed in http:// it would have worked and connected to your site.

Most people don't type in the http:// when entering their website. Any idea of what needs to be changed to allow a simple www to work?

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

Unless I'm missing something, this sounds like a website configuration issue and not an issue with your web page. You may want to bring this up to your website hosting provider.

If you give me the url to enter to see the problem I may be able to help more. It sounds like a mis-configured .htaccess file.

Sign in to reply to this post
Did this help? Tips are appreciated...

balexander389215

If you check out here:

http://www.songwritersinconcert.com/profileVs.php?id=383

Now hovering over the link without clicking shows the destination address to be the one strqange one shown above.

There really isn't anything in the htaccess file.

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Sign in to reply to this post

Ray BorduinWebAssist

A link without http:// or https:// will always be considered page relative by your browser. If this is from an input form then you would have to add the http:// if it was missing.

If you post your file or the code you use to generate the link then I could help you with a quick solution in php.

Sign in to reply to this post
Did this help? Tips are appreciated...

balexander389215

Yes I see what you mean.

Attached Files
venureRegister.php
Sign in to reply to this post

Ray BorduinWebAssist

In the bindings instead of:

php:
<?php echo((isset($_POST["Website"]))?$_POST["Website"]:""); ?>


try:

php:
<?php echo(!empty($_POST["Website"])? ((strpos(strtolower($_POST["Website"]), "http") !== 0)?"http://".$_POST["Website"]:$_POST["Website"]):""); ?>



Another simple solution is to use <input type="url"> and then most browsers will automatically require them to add the http:// or https:// before the form submits.

Sign in to reply to this post
Did this help? Tips are appreciated...

balexander389215

Thanks Ray, though I'm a little confused. The binding looks like this.

$InsertQuery->bindColumn("Website", "s", "".((isset($_POST["Website"]))?$_POST["Website"]:"") ."", "WA_DEFAULT");

There is no php echo to replace so I'm not sure just where the php echo function should start and end. I keep trying different things but get syntax error.

Sign in to reply to this post

Ray BorduinWebAssist

If you open the Server Behavior it will have the syntax I mentioned. If you want to update the code directly it would be:

$InsertQuery->bindColumn("Website", "s", "".(!empty($_POST["Website"])? ((strpos(strtolower($_POST["Website"]), "http") !== 0)?"http://".$_POST["Website"]:$_POST["Website"]):"") ."", "WA_DEFAULT");
Sign in to reply to this post
Did this help? Tips are appreciated...

balexander389215

I get a syntax error. I also figured out what you meant on the other one where I was to make the change in the Insert record bindings so I tried that and also got a syntax error.

Sign in to reply to this post

balexander389215

I got it in without the syntax error and tested it out. Unfortunately however it did not work. The entry in the database is still without http and the same error occurs when I try to open the link.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...