Edit Profile Error

Issues related to the Login tools of WYSIWYG Web Builder.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html

TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Edit Profile Error

Post by Markoc » Tue Jun 12, 2018 7:14 pm

Hi, I am getting this error message when I try to get to the edit profile page. I am logged in at the time. Not sure what is causing it?


Parse error: syntax error, unexpected '" "' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in /home/content/62/3698662/html/members2018test/login_ppocc/editprofileppocc.php on line 278


when I check the html code line 278 refers to email but I cannot see anything wrong.

Thanks

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 5:55 am

What code is on line 278?

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 11:23 am

The error showed # 278

276 <tr>
277 <td class="label"><label for="email">E-mail</label></td>
278 </tr>
279 <tr>
280 <td class="row"><input class="input" name="email" type="text" id="email" value="<?php echo $db_email; ?>"></td>
281 </tr>


I also did a different edit profile page with the basic edit profile object and the error was # 297
294 <tr>
295 <td class="label"><label for="confirmpassword">Confirm Password</label></td>
296 </tr>
297 <tr>
298 <td class="row"><input class="input" name="confirmpassword" type="password" id="confirmpassword"></td>
299 </tr>
300 <tr>

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 11:29 am

Are you sure this is the correct code?
Because an error on this line does not make any sense.

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 12:10 pm

The signup page and the admin page both work fine for adding new users. For some reason though the admin edit users doesn't save a new avatar.

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 12:53 pm

I think the problem is related to the HTML formatting option sin Tools -> options -> HTML
Can you please set all options to their defaults?

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 5:54 pm

WOW, you are good at what you do! That cured a few ills I was having.

A while back there was an issue with the Avatar not displaying when editing a record after converting the form to html. You mentioned there was a fix in an update. I have the update but the Avatar does not display. Did that get fixed or am I missing something?

Thanks again!

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 6:03 pm

Did that get fixed or am I missing something?
Yes, that issue was fixed.

User avatar
BaconFries
 
 
Posts: 4150
Joined: Thu Aug 16, 2007 7:32 pm

Re: Edit Profile Error

Post by BaconFries » Wed Jun 13, 2018 6:05 pm

Yes that has already been fixed. The latest build is - WYSIWYG Web Builder 14.0.4 (build date: June 12, 2018)
You can download at the following: Download

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 7:22 pm

Hmmm, I was on 14.0.3 and it didn't display the avatar. I downloaded and installed 14.0.4 and still no Avatar.

The Admin update module do not seem to be update anything now.

The edit profile using html form does save text updates with the exception of the avatar. The avatar doesn't display. If I browse for a new avatar I can select one but it doesn't save it.

If I edit profile using the non html version it displays and saves everything fine. My problem is that I need two of the fields to be text areas which is not available as is.

I am at a loss?

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 7:30 pm

Here is a test username and password if that helps.

www.ppocc.org/members2018test/

go to Members only drop down.

username: suewhite
password: mark39

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 8:26 pm

Did you create the avatar folder on the server?
Does it have write permissions?

Note that once you have converted a login form to a standard form, the code will be unchanged.
So, the fix only applies to new forms.

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 8:57 pm

The avatar folder is on the server. When I add a new user I can add the avatar.

I'll try redoing the form again from the unconverted form. I didn't convert the admin form and that doesn't let me update user information?

Thanks for working this through for me. It's looking good so far with a few glitches.

Markoc
 
 
Posts: 65
Joined: Tue May 29, 2018 12:19 am

Re: Edit Profile Error

Post by Markoc » Wed Jun 13, 2018 9:06 pm

I did what you said and still no avatar displays. I can browse for a new avatar but it doesn't save. Other data is saved though.

http://www.ppocc.org/members2018test/lo ... ccform.php

Here is the source code for the page if that helps:

<?php
if (session_id() == "")
{
session_start();
}
if (!isset($_SESSION['username']))
{
$accessdenied_page = './loginppocc2.php';
header('Location: '.$accessdenied_page);
exit;
}
$mysql_server = 'ppocc_members.db.3698662.hostedresource.com';
$mysql_username = 'ppocc_members';
$mysql_password = 'xxxxxxxxxx';
$mysql_database = 'ppocc_members';
$mysql_table = 'ppocc_members2018';
$error_message = '';
$db_username = '';
$db_fullname = '';
$db_email = '';
$db_avatar = '';
$db_extra1 = '';
$db_extra2 = '';
$db_extra3 = '';
$db_extra4 = '';
$db_extra5 = '';
$db_extra6 = '';
$db_extra7 = '';
$db_extra8 = '';
$db_extra9 = '';
$db_extra10 = '';
$db_extra11 = '';
$db_extra12 = '';
$db_extra13 = '';
$avatar_folder = 'avatars';
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_name']) && $_POST['form_name'] == 'editprofileform')
{
$success_page = './../index.php';
$oldusername = $_SESSION['username'];
$newusername = $_POST['username'];
$newemail = $_POST['email'];
$newpassword = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
$newfullname = $_POST['fullname'];
$extra1 = $_POST['extra1'];
$extra2 = $_POST['extra2'];
$extra3 = $_POST['extra3'];
$extra4 = $_POST['extra4'];
$extra5 = $_POST['extra5'];
$extra6 = $_POST['extra6'];
$extra7 = $_POST['extra7'];
$extra8 = $_POST['extra8'];
$extra9 = $_POST['extra9'];
$extra10 = $_POST['extra10'];
$extra11 = $_POST['extra11'];
$extra12 = $_POST['extra12'];
$extra13 = $_POST['extra13'];
if ($newpassword != $confirmpassword)
{
$error_message = 'Password and Confirm Password are not the same!';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$]{1,50}$/", $newusername))
{
$error_message = 'Username is not valid, please check and try again!';
}
else
if (!empty($newpassword) && !preg_match("/^[A-Za-z0-9_!@$]{1,50}$/", $newpassword))
{
$error_message = 'Password is not valid, please check and try again!';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$.' &]{1,50}$/", $newfullname))
{
$error_message = 'Fullname is not valid, please check and try again!';
}
else
if (!preg_match("/^.+@.+\..+$/", $newemail))
{
$error_message = 'Email is not a valid email address. Please check and try again.';
}
else
{
$avatar_max_width = 256;
$avatar_max_height = 256;
$newavatar = '';
if (isset($_FILES['avatar']) && $_FILES['avatar']['name'] != "")
{
switch ($_FILES['avatar']['error'])
{
case UPLOAD_ERR_OK:
if ($_FILES['avatar']['type'] == 'image/gif' || $_FILES['avatar']['type'] == 'image/jpeg' || $_FILES['avatar']['type'] == 'image/pjpeg' || $_FILES['avatar']['type'] == 'image/png' || $_FILES['avatar']['type'] == 'image/x-png')
{
list($width, $height) = getimagesize($_FILES['avatar']['tmp_name']);
if ($width <= $avatar_max_width && $height <= $avatar_max_height)
{
$prefix = rand(111111, 999999);
$newavatar = $prefix . "_" . str_replace(" ", "_", $_FILES['avatar']['name']);
if (!move_uploaded_file($_FILES['avatar']['tmp_name'], $avatar_folder . "/" . $newavatar))
{
$error_message = "Upload failed, please verify the folder's permissions.";
}
}
else
{
$error_message = "The image is too big.";
}
}
else
{
$error_message = "Wrong file type, please only use jpg, gif or png images.";
}
break;
case UPLOAD_ERR_INI_SIZE:
$error_message = "The uploaded file exceeds the 'upload_max_filesize' directive.";
break;
case UPLOAD_ERR_FORM_SIZE:
$error_message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.";
break;
case UPLOAD_ERR_PARTIAL:
$error_message = "The uploaded file was only partially uploaded.";
break;
case UPLOAD_ERR_NO_FILE:
$error_message = "No file was uploaded.";
break;
case UPLOAD_ERR_NO_TMP_DIR:
$error_message = "Missing a temporary folder.";
break;
case UPLOAD_ERR_CANT_WRITE:
$error_message = "Failed to write file to disk.";
break;
case UPLOAD_ERR_EXTENSION:
$error_message = "File upload stopped by extension.";
break;
}
}
$db = mysqli_connect($mysql_server, $mysql_username, $mysql_password);
if (!$db)
{
die('Failed to connect to database server!<br>'.mysqli_error($db));
}
mysqli_select_db($db, $mysql_database) or die('Failed to select database<br>'.mysqli_error($db));
mysqli_set_charset($db, 'utf8');
if ($oldusername != $newusername)
{
$sql = "SELECT username FROM ".$mysql_table." WHERE username = '".mysqli_real_escape_string($db, $newusername)."'";
$result = mysqli_query($db, $sql);
if ($data = mysqli_fetch_array($result))
{
$error_message = 'Username already used. Please select another username.';
}
}
if (empty($error_message))
{
$crypt_pass = md5($newpassword);
$newusername = mysqli_real_escape_string($db, $newusername);
$newemail = mysqli_real_escape_string($db, $newemail);
$newfullname = mysqli_real_escape_string($db, $newfullname);
$extra1 = mysqli_real_escape_string($db, $extra1);
$extra2 = mysqli_real_escape_string($db, $extra2);
$extra3 = mysqli_real_escape_string($db, $extra3);
$extra4 = mysqli_real_escape_string($db, $extra4);
$extra5 = mysqli_real_escape_string($db, $extra5);
$extra6 = mysqli_real_escape_string($db, $extra6);
$extra7 = mysqli_real_escape_string($db, $extra7);
$extra8 = mysqli_real_escape_string($db, $extra8);
$extra9 = mysqli_real_escape_string($db, $extra9);
$extra10 = mysqli_real_escape_string($db, $extra10);
$extra11 = mysqli_real_escape_string($db, $extra11);
$extra12 = mysqli_real_escape_string($db, $extra12);
$extra13 = mysqli_real_escape_string($db, $extra13);
$sql = "UPDATE `".$mysql_table."` SET `username` = '$newusername', `fullname` = '$newfullname', `email` = '$newemail', `extra1` = '$extra1', `extra2` = '$extra2', `extra3` = '$extra3', `extra4` = '$extra4', `extra5` = '$extra5', `extra6` = '$extra6', `extra7` = '$extra7', `extra8` = '$extra8', `extra9` = '$extra9', `extra10` = '$extra10', `extra11` = '$extra11', `extra12` = '$extra12', `extra13` = '$extra13' WHERE `username` = '$oldusername'";
mysqli_query($db, $sql);
if (!empty($newpassword))
{
$sql = "UPDATE `".$mysql_table."` SET `password` = '$crypt_pass' WHERE `username` = '$oldusername'";
mysqli_query($db, $sql);
}
if (!empty($newavatar))
{
$sql = "UPDATE `".$mysql_table."` SET `avatar` = '$newavatar' WHERE `username` = '$oldusername'";
mysqli_query($db, $sql);
$_SESSION['avatar'] = "http://".$_SERVER['HTTP_HOST'] . "login_ppocc/avatars/" . $newavatar;
}
}
mysqli_close($db);
if (empty($error_message))
{
$_SESSION['username'] = $newusername;
$_SESSION['fullname'] = $newfullname;
header('Location: '.$success_page);
exit;
}
}
}
$db = mysqli_connect($mysql_server, $mysql_username, $mysql_password);
if (!$db)
{
die('Failed to connect to database server!<br>'.mysqli_error($db));
}
mysqli_select_db($db, $mysql_database) or die('Failed to select database<br>'.mysqli_error($db));
mysqli_set_charset($db, 'utf8');
$sql = "SELECT * FROM ".$mysql_table." WHERE username = '".$_SESSION['username']."'";
$result = mysqli_query($db, $sql);
if ($data = mysqli_fetch_array($result))
{
$db_username = $data['username'];
$db_fullname = $data['fullname'];
$db_email = $data['email'];
$db_avatar = $data['avatar'];
$db_extra1 = $data['extra1'];
$db_extra2 = $data['extra2'];
$db_extra3 = $data['extra3'];
$db_extra4 = $data['extra4'];
$db_extra5 = $data['extra5'];
$db_extra6 = $data['extra6'];
$db_extra7 = $data['extra7'];
$db_extra8 = $data['extra8'];
$db_extra9 = $data['extra9'];
$db_extra10 = $data['extra10'];
$db_extra11 = $data['extra11'];
$db_extra12 = $data['extra12'];
$db_extra13 = $data['extra13'];
}
mysqli_close($db);
?>

User avatar
Pablo
 
Posts: 14114
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Edit Profile Error

Post by Pablo » Wed Jun 13, 2018 9:14 pm

I'm sorry, but where is currently the problem? In the admin or in edit profile?

Note that I cannot see anything by login into your the page.
I need all to know all settings and all generated code to be able to help you.
Did you edit the code?
Did it work before you converted it to a standard form?
Are there any errors in the PHP log on the server?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests