[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help, need to compare 2 php files and fix the old one

Posted on 2014-04-08
8
Medium Priority
?
29 Views
Last Modified: 2016-05-21
Hello, I have a big problem and I need help please.

After wordpress updating from 3.5.2 to 3.6+ I have a problem with a specific function of a php file.

This file is responsible for any extra user data (eg city, country, etc.) which are stored in wp_usermeta table.
My knowledge in php is minimal. I managed and found a newer file but has too many differences and I can not figure out which are the data I need.

The old one works fine for everything else except this piece of code:

        $_POST['form']['ID'] 		= $userdata->ID;
		$_POST['form']['jabber']  	= $_POST['address']['country']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['state']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['address']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['city']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['zip']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['phone'];

Open in new window


This piece of code if operated, would create inside wp_usermeta table, a meta_key "jabber" & a meta_value "country*state*address*city*zip*phone"

This file is also responsible for other things like User Name, Surname, email, orders etc. Everything works fine except the previous code.

I have also try to manually add the records in database and my sript read the user data without problems, the only problem is to save the data.

This is the old php file with the problem:
OldPhp

This is the new one I found but it has many changes:
NewPhp


Please help me, Nicolas
0
Comment
Question by:Nicolas Lagios
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 39987852
Can you describe in which way it is breaking? eg is it throwing an error?
0
 
LVL 15

Expert Comment

by:eemit
ID: 39988408
- Make a backup first then
- Update to WordPress 3.8.2
- Post here if error still occur
0
 

Author Comment

by:Nicolas Lagios
ID: 39988626
TerryAtOpus
No its not an error. The problem is that I can't save the user extra data, city country etc, but everything else works

eemit
After wordpress updating to 3.8.2, the problem still remains.


A guy in stackoverflow site told me:
ust realised it's a plugin (opened link). Are you sure it is those lines of code that's causing it? Steps to debug would be- check the $_POST data and then if that checks out, have a look at the $userdata variable and make sure it's not using a deprecated function

What should I do? My php knowledge are limited.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 15

Expert Comment

by:eemit
ID: 39990977
1)
Files you have posted are the same

2)
As this is a commercial theme, you need to seek support from the theme vendors.
0
 
LVL 35

Accepted Solution

by:
Terry Woods earned 2000 total points
ID: 39993206
@eemit, the posted files are different for me; maybe you made a mistake?

Anyway, I've made an attempt at modifying the "new" code to incorporate the post data like the old code does. My changes are clearly labelled.

Please find the code attached.
ee-new.php
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 39993208
It's reasonably likely that it won't work; it's clearly not meant to be modified in the way you've modified it.

However, it does look like the new code is intended to handle custom data (in a way that's meant to be done!). The code labelled with "// SAVE THE CUSTOM PROFILE DATA" indicates that. Perhaps you can find something that makes use of it for collecting your extra data?
0
 
LVL 8

Expert Comment

by:Sam Cohen
ID: 40334003
Download sublimetext http://www.sublimetext.com/
It has a excellent file comparing feature..
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question